Hi, I am having a hard time getting my logstash pipeline to process messages efficiently.
I am running at 100% CPU utilization (4 CPUs and 4 pipeline workers) and only processing about 20-30 documents a minute (measured using the metrics plugin). /etc/logstash/Test/testlog.log
is just a 1gb file of about 9 common log lines repeated. Memory usage remains low (8gb available)
I am unsure at this point whether or not the number of CPUs is the issue or if it is the grok filters I am using.
Using only %{GREEDYDATA:logmessage}"
as the grok filter it shoots up to over 15k every minute so I am more inclined to think that I am using the grok filters incorrectly.
If anyone is able to spot a way i can improve the grok filter I'd be a very happy chappy
I can also try throwing more CPUs at it however I want to be sure I am not doing something silly with my filtering first.
My config:
input {
file {
path => [ "/etc/logstash/Test/testlog.log" ]
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
metrics {
meter => "documents"
add_tag => "metric"
}
grok {
match => [
"message", "%{INT:Version} %{DATA:EventTime} %{DATA:LoggedTime} %{INT:SeqNo} %{INT:Level} %{DATA:NetworkAddr} %{WORD:HostName} %{WORD:AppName} %{INT:DiscardCount} %{INT:heartbeat} %{INT:Flags} %{WORD:OperationType}: %{UUID:Id}: %{GREEDYDATA:logmessage}",
"message", "%{INT:Version} %{DATA:EventTime} %{DATA:LoggedTime} %{INT:SeqNo} %{INT:Level} %{DATA:NetworkAddr} %{WORD:HostName} %{WORD:AppName} %{INT:DiscardCount} %{INT:heartbeat} %{INT:Flags} %{WORD:OperationType}: %{NUMBER:mstaken}ms %{UUID:Id}: %{GREEDYDATA:logmessage}",
"message", "%{INT:Version} %{DATA:EventTime} %{DATA:LoggedTime} %{INT:SeqNo} %{INT:Level} %{DATA:NetworkAddr} %{WORD:HostName} %{WORD:AppName} %{INT:DiscardCount} %{INT:heartbeat} %{INT:Flags} %{GREEDYDATA:logmessage}",
"message", "(?<logmessage>Soss.*)"
]
}
}
output {
if "_grokparsefailure" in [tags] {
file { path => "/tmp/grok_errors.log" }
}
if "metric" in [tags] {
stdout {
codec => line {
format => "1m rate: %{[documents][rate_1m]} ( %{[documents][count]} )"
}
}
}
}
Thank you!