2017-02-28 4 views
0

のテキスト内を検索:Kibana:私は、この含まれていKibanaにログメッセージを持っている文字列

org.hibernate.exception.GenericJDBCException: Cannot open connection 
at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:597) 
結果を返していない

実際の検索:LOG_MESSAGE:「Hibernate3の」

私が検索する場合"hibernate3"このメッセージは表示されません。私はElasticsearchテンプレートを使用しており、フィールドのインデックスを作成していますが、大文字と小文字を区別しない全文検索も可能にしたいと考えています。これは可能ですか?使用されている

テンプレート:

{ 
"template": "filebeat-*", 
"mappings": { 
    "mainProgram": { 
     "properties": { 
      "@timestamp": { 
       "type": "date", 
       "format": "strict_date_optional_time||epoch_millis" 
      }, 
      "@version": { 
       "type": "text" 
      }, 
      "beat": { 
       "properties": { 
        "hostname": { 
         "type": "text" 
        }, 
        "name": { 
         "type": "text" 
        } 
       } 
      }, 
      "class_method": { 
       "type": "text", 
       "fielddata": "true", 
       "index": "true" 
      }, 
      "class_name": { 
       "type": "text", 
       "fielddata": "true" 
      }, 
      "clientip": { 
       "type": "ip", 
       "index": "not_analyzed" 
      }, 
      "count": { 
       "type": "long" 
      }, 
      "host": { 
       "type": "text", 
       "index": "not_analyzed" 
      }, 
      "input_type": { 
       "type": "text", 
       "index": "not_analyzed" 
      }, 
      "log_level": { 
       "type": "text", 
       "fielddata": "true", 
       "index": "true" 
      }, 
      "log_message": { 
       "type": "text", 
       "index": "true" 
      }, 
      "log_timestamp": { 
       "type": "text" 
      }, 
      "log_ts": { 
       "type": "long", 
       "index": "not_analyzed" 
      }, 
      "message": { 
       "type": "text" 
      }, 
      "offset": { 
       "type": "long", 
       "index": "not_analyzed" 
      }, 
      "query_params": { 
       "type": "text", 
       "index": "true" 
      }, 
      "sessionid": { 
       "type": "text", 
       "index": "true" 
      }, 
      "source": { 
       "type": "text", 
       "index": "not_analyzed" 
      }, 
      "tags": { 
       "type": "text" 
      }, 
      "thread": { 
       "type": "text", 
       "index": "true" 
      }, 
      "type": { 
       "type": "text" 
      }, 
      "user_account_combo": { 
       "type": "text", 
       "index": "true" 
      }, 
      "version": { 
       "type": "text" 
      } 
     } 
    }, 
    "access": { 
     "properties": { 
      "@timestamp": { 
       "type": "date", 
       "format": "strict_date_optional_time||epoch_millis" 
      }, 
      "@version": { 
       "type": "text" 
      }, 
      "beat": { 
       "properties": { 
        "hostname": { 
         "type": "text" 
        }, 
        "name": { 
         "type": "text" 
        } 
       } 
      }, 
      "clientip": { 
       "type": "ip", 
       "index": "not_analyzed" 
      }, 
      "count": { 
       "type": "long", 
       "index": "not_analyzed" 
      }, 
      "host": { 
       "type": "text", 
       "index": "true" 
      }, 
      "input_type": { 
       "type": "text", 
       "index": "not_analyzed" 
      }, 
      "log_timestamp": { 
       "type": "text" 
      }, 
      "log_ts": { 
       "type": "long", 
       "index": "not_analyzed" 
      }, 
      "message": { 
       "type": "text" 
      }, 
      "offset": { 
       "type": "long", 
       "index": "not_analyzed" 
      }, 
      "query_params": { 
       "type": "text", 
       "index": "true" 
      }, 
      "response_time": { 
       "type": "long" 
      }, 
      "sessionid": { 
       "type": "text", 
       "index": "true" 
      }, 
      "source": { 
       "type": "text", 
       "index": "not_analyzed" 
      }, 
      "statuscode": { 
       "type": "long" 
      }, 
      "tags": { 
       "type": "text" 
      }, 
      "thread": { 
       "type": "text", 
       "index": "true" 
      }, 
      "type": { 
       "type": "text", 
       "index": "true" 
      }, 
      "uripath": { 
       "type": "text", 
       "index": "true" 
      }, 
      "user_account_combo": { 
       "type": "text", 
       "index": "true" 
      }, 
      "verb": { 
       "type": "text", 
       "index": "true" 
      } 
     } 
    } 
} 
} 

答えて

0

あなたのシナリオによると、あなたが探しているのはは、まずそれを文字列を解析して、インデックスうタイプstringを解析しています。 docからの引用。

つまり、このフィールドはフルテキストとしてインデックス付けします。

したがって、あなたがドキュメント上全文検索を行うことができるようになりますように、あなたが適切に必要なフィールドのあなたのマッピングを持っている、ことを確認してください。ログ行がフィールドmessage下にある場合Kibanaに、あなたは、単にで単語を検索することができ、と仮定すると

Term Based間の差異を識別するために、あなたはまたthisを参照したいかもしれません

message:"hibernate3" 

Full-Text

EDIT

は、次のようなフィールドlog_messageのマッピングを持っている:また、のようなワイルドカード検索を行う試す

"log_message": { 
     "type": "string", <- to make it analyzed 
     "index": "true" 
} 

{"wildcard":{"log_message":"*.hibernate3.*"}} 

この情報がお役に立てば幸い!

+0

何らかの理由でこれが機能していません。 log_message: "。hibernate3"結果を返しません。 - ここで、log_messageはmessageのサブセットです。私のElasticSearchテンプレートはこれをインデックスにしています:log_message \tタイプ\tテキストインデックス\t TRUE –

+0

テンプレートを –

+0

に更新しました。つまり、木場には「log_message」というフィールドはありません。 – Kulasangar

関連する問題