Answer the question
In order to leave comments, you need to log in
How to parse log using Logstash?
There is a log:
{«message»:»1353480: CORE-DSS: Mar 10 06:22:06.711: %SEC-6-IPACCESSLOGP: list inside_DSS denied udp 10.22.110.61(60980) -> 255.255.255.255(1947), 1 packet «,»@version»:»1″,»@timestamp»:»2015-03-10T07:11:31.697Z»,»type»:»all_log»,»host»:»10.23.0.200″}
denied udp 10.22.110.61(60980) -> 255.255.255.255(1947)
2015-03-10T07:11:31 denied udp 10.22.110.61(60980) -> 255.255.255.255(1947) host 10.23.0.200
input {
udp {
type => «all_log»
port => 3000
}
}
filter {
grok {
type => «all_log»
pattern => «%{WORD} %{PROG} %{NOTSPACE} -> %{NOTSPACE}»
}
}
output {
elasticsearch {
embedded => «true»
host => «localhost»
}
file {
path => «/srv/LOG/LOG_all/all.oblast.log»
}
}
Answer the question
In order to leave comments, you need to log in
I would advise you to break the message into parts completely through the filter, like hello, this is how they do it for IIS logs
grok {
# check that fields match your IIS log settings
match => ["message", "%{TIMESTAMP_ISO8601:log_timestamp} %{IPORHOST:site} %{WORD:method} %{URIPATH:page} %{NOTSPACE:querystring} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clienthost} %{NOTSPACE:useragent} %{NUMBER:response} %{NUMBER:subresponse} %{NUMBER:scstatus} %{NUMBER:time_taken}"]
}
file {
path => «/srv/LOG/LOG_all/all.oblast.log»
}
The example message is taken from a file. Messages to the file go only when the lines related to filter are commented out (ie, when the filter is disabled). I watched the video but didn't understand what it was about. Your idea about breaking the message into parts completely, I caught it. For my filter, I just used the site you specified and I can break the entire log message into parts. But again, the question is what to do with this partition, how to get the desired result?
Installed Sense for Crome in the line SERVER localhost:9200 I write instead of localhost the IP address of the server and specify port 9200, but nothing happens. The string is returned to localhost:9200.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question