elasticsearch - custom parse with logstash and elastic search -


I'm new to logstash!
I have configured and everything is working fine - yet.
Comes in the form of my log file:

  2014-04-27 16:24:43 DEBUG b45e66 T + 561 10.31.166.155 / V1 / XXX & lt ;! Session & gt; XXX has requested category_ids: only_pro: XXX_ids: 14525  

If I use the following config file:

  input {file {path = & Gt; "/ Log / * _log"}} output {elasticsearch {host = & gt; Localhost}}  

This will be given the following position in the ES:

  {_index: "logstash-2014.04.28", _type: "log", _id : "WIoUbIvCQOqnz4tMZzMohg", _score: 1, _source: {Message: "2014-04-27 16:24:43 DEBUG b45e66 T + 561 10.31.166.155 This is my log!", @Version: "1", @ TeamStamp: "2014-04-28 T 14: 25: 52.165 J", host: "MYCOMPUTER", path: "\ logs \ xxx_app.log"}}  

How do I get the string My logs so that the entire text is not on _source.message?
Eg: I think I can parse something like this:

  {_index: "logstash-2014.04.28", _type: "logs", _id: "wuiibiqq Okanz 4 tmjes mehag ", _score: 1, _source: {log life:" debuts ", message id:" b 45 e66 ", send dispatch:" 10.31.166.155 ", logtimestamp:" 2014-04-27 16:24 : 43 ", Message:" This is my log! ", @Version:" 1 ", @ TeamStamp:" 2014-04-28 T 14: 25: 52.165J ", host:" MYCOMPUTER ", path:" \ log \ Xxx_app log "}}  

Need to RSA, eg. This can be quite difficult, so be patient and try, try, try, try.

% {DATESTAMP}% {WORD: logLevel}% {WORD: messageId}

Your message will begin. % {GREEDYDATA: someString}% {IP}

is a very useful tool for your help.

When done, your config should look like this

  input {stdin {}} filter {grok {match = & gt; {"Message" = & gt; "% {DATESTAMP}% {WORD: logLevel}% {WORD: messageId}% {gradiadata: someString}% {IP}"}}} Output {Elastic Search {host = & gt; Localhost}}  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -