I would like to use logstash to format my logs.
Specifically, I have a log with the following format
format:
timestamp [thread-name] log-level class-name - log-message
example:
2021-03-30 09:38:20.201 [ConnectionChecker] ERROR c.b.a.websocket.WebSocketOnlineUser - SendPing failed. roomHash:null,roomUserHashnull,error:org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSING], expecting [OPEN or CONNECTED]
I am hoping that I can use the filter plugin to get the 5 items separately, but that doesn't work.
If the problem can be solved with a method other than csv filter, that method is also welcome.
Here is the description and output of the filter I set in config.
... snip ...
filter {
csv {
separator => " "
skip_header => true
}
}
... snip ...
{
"host" => "ITS-ELS-01",
"column1" => "2021-03-30 09:38:20.201\t[ConnectionChecker]\tERROR\tc.b.a.websocket.WebSocketOnlineUser - SendPing failed. roomHash:null,roomUserHashnull,error:org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSING], expecting [OPEN or CONNECTED]",
"@timestamp" => 2021-03-30T11:05:40.582Z,
"message" => "2021-03-30 09:38:20.201\t[ConnectionChecker]\tERROR\tc.b.a.websocket.WebSocketOnlineUser - SendPing failed. roomHash:null,roomUserHashnull,error:org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint unavailable, current state [CLOSING], expecting [OPEN or CONNECTED]",
"@version" => "1"
}