Hi!
I have logs that have fields together or fields pasted together, and I don't know how to separate them. Here's a screenshot of how it looks in Kibana and another how it looks in Logstash.
I need help with this as I'm new around here.
Thank you very much in advance.
Logstash Code:
else if "performanceLog" in [path]
{
grok
{
match => {"message" => "(?<timestamp>%{YEAR:year}/%{MONTHNUM:month}/%{MONTHDAY:day}-%{TIME:date}) \| %{USERNAME:username} \| %{DATA:balcao} \| %{DATA:server} \| %{DATA:transaction} \| %{BASE16FLOAT:timed}|%{GREEDYDATA:message}" }
overwrite => [ "message" ]
match => {"message" => "(?<timestamp>%{YEAR:year}/%{MONTHNUM:month}/%{MONTHDAY:day}-%{TIME:date}) \| %{USERNAME:username} \| %{DATA:balcao} \| %{DATA:server} \| %{DATA:transaction}\|%{DATA:identificador} \| %{BASE16FLOAT:timed}|%{GREEDYDATA:message}" }
overwrite => [ "message" ]
match => {"message" => "(?<timestamp>%{YEAR:year}/%{MONTHNUM:month}/%{MONTHDAY:day}-%{TIME:date}) \| %{USERNAME:username} \| %{DATA:balcao} \| %{DATA:server} \| %{DATA:transaction}\|%{DATA:volta}\|(?<timestampperformance>%{YEAR:}/%{MONTHNUM:}/%{MONTHDAY:}-%{TIME:})\|%{DATA:identificador} \| %{BASE16FLOAT:timed}|%{GREEDYDATA:message}" }
}
mutate
{
add_field => {
"transaction" => "%{[transaction][0]}"
"volta" => "%{[transaction][1]}"
"timestampperformance" => "%{[transaction][2}"
"identificador" => "%{[transaction][3]}"
}
}
ruby
{
code => 'event.set("time", (event.get("timed").to_f))'
}
}