I have this type of logfile:
Events of MHSendMessagesService
* STOP *
0320 *** START ***
* Module: C:\Program Files (x86)\PST\Million Handshakes\Dialog Server\MHSendMessagesService.exe
* Version: 6.1.4.931
* Computer: DELTA40001
* UserName: PDsvc-DELTA40001
* Address IP: 10.100.1.130
2019-01-07 8:36:19.843 1390 [DELTA -] Starting to send messages on output channel 1001, queue 0
2019-01-07 8:36:19.844 1390 [DELTA -] Call DialogServer.SendMessages
2019-01-07 8:36:20.763 1390 [DELTA -] End DialogServer.SendMessages last 0 seconds
2019-01-07 8:36:20.763 1390 [DELTA -] Sent 1 messages in transaction 1 on output channel 1001, queue 0
2019-01-07 8:36:20.764 1390 [DELTA -] Call DialogServer.SendMessages
2019-01-07 8:36:20.787 1390 [DELTA -] End DialogServer.SendMessages last 0 seconds
2019-01-07 8:36:20.788 1390 [DELTA -] Completed sending messages on output channel 1001, queue 0
2019-01-07 9:21:18.409 13C4 [DELTA -] Starting to send messages on output channel 1001, queue 0
2019-01-07 9:21:18.410 13C4 [DELTA -] Call DialogServer.SendMessages
2019-01-07 9:21:19.498 13C4 [DELTA -] End DialogServer.SendMessages last 1 seconds
2019-01-07 9:21:19.499 13C4 [DELTA -] Sent 3 messages in transaction 1 on output channel 1001, queue 0
2019-01-07 9:21:19.500 13C4 [DELTA -] Call DialogServer.SendMessages
2019-01-07 9:21:19.517 13C4 [DELTA -] End DialogServer.SendMessages last 0 seconds
2019-01-07 9:21:19.518 13C4 [DELTA -] Completed sending messages on output channel 1001, queue 0
2019-01-07 9:35:24.911 13FC [DELTA -] Starting to send messages on output channel 1022, queue 0
2019-01-07 9:35:24.911 1484 [DELTA -] Starting to send messages on output channel 1001, queue 0
2019-01-07 9:35:24.911 13FC [DELTA -] Call DialogServer.SendMessages
2019-01-07 9:35:24.912 1484 [DELTA -] Call DialogServer.SendMessages
2019-01-07 9:35:25.032 13FC [DELTA -] End DialogServer.SendMessages last 0 seconds
2019-01-07 9:35:25.033 13FC [DELTA -] Sent 1 messages in transaction 1 on output channel 1022, queue 0
2019-01-07 9:35:25.034 13FC [DELTA -] Call DialogServer.SendMessages
2019-01-07 9:35:25.144 13FC [DELTA -] End DialogServer.SendMessages last 0 seconds
2019-01-07 9:35:25.145 13FC [DELTA -] Sent 1 messages in transaction 2 on output channel 1022, queue 0
2019-01-07 9:35:25.146 13FC [DELTA -] Call DialogServer.SendMessages
2019-01-07 9:35:25.225 13FC [DELTA -] End DialogServer.SendMessages last 0 seconds
2019-01-07 9:35:25.225 13FC [DELTA -] Sent 1 messages in transaction 3 on output channel 1022, queue 0
2019-01-07 9:35:25.226 13FC [DELTA -] Call DialogServer.SendMessages
2019-01-07 9:35:25.300 13FC [DELTA -] End DialogServer.SendMessages last 0 seconds
2019-01-07 9:35:25.301 13FC [DELTA -] Sent 1 messages in transaction 4 on output channel 1022, queue 0
2019-01-07 9:35:25.302 13FC [DELTA -] Call DialogServer.SendMessages
2019-01-07 9:35:25.369 13FC [DELTA -] End DialogServer.SendMessages last 0 seconds
2019-01-07 9:35:25.370 13FC [DELTA -] Sent 1 messages in transaction 5 on output channel 1022, queue 0
2019-01-07 9:35:25.370 13FC [DELTA -] Call DialogServer.SendMessages
2019-01-07 9:35:25.388 13FC [DELTA -] End DialogServer.SendMessages last 0 seconds
2019-01-07 9:35:25.388 13FC [DELTA -] Completed sending messages on output channel 1022, queue 0
2019-01-07 9:35:26.169 1484 [DELTA -] End DialogServer.SendMessages last 1 seconds
2019-01-07 9:35:26.169 1484 [DELTA -] Sent 5 messages in transaction 1 on output channel 1001, queue 0
2019-01-07 9:35:26.170 1484 [DELTA -] Call DialogServer.SendMessages
2019-01-07 9:35:26.198 1484 [DELTA -] End DialogServer.SendMessages last 0 seconds
2019-01-07 9:35:26.199 1484 [DELTA -] Completed sending messages on output channel 1001, queue 0
So I have 4 types of lines that I want to react on
Starting
Sent
End
Completed
Sent and End can appear multiple times withing Starting and Completed, and the lines can be jumbled between each other, so at a later stage I have to use aggregate.
The rest I just want to ignore.
So I wanted to create a GROK filter.
First line to handle (the lines all start with two spaces):
2019-01-07 7:06:57.948 0320 [DELTA -] Starting to send messages on output channel 1001, queue 0
This could match:
"^ %{NOTSPACE:date}%{SPACE}%{TIME:time} %{WORD:taskid} \[%{WORD:instance name} -] %{WORD:status} to send %{GREEDYDATA}$"
Second line to handle:
2019-01-07 7:21:58.554 11EC [DELTA -] End DialogServer.SendMessages last 3 seconds
Match:
"^ %{NOTSPACE:date}%{SPACE}%{TIME:time} %{WORD:taskid} \[%{WORD:instance name} -] %{WORD:status} %{NOTSPACE} %{NOTSPACE} {INT:number2} seconds$"}"
Third line:
2019-01-07 7:37:45.074 13F8 [DELTA -] Sent 15 messages in transaction 1 on output channel 1001, queue 0
Match:
"^ %{NOTSPACE:date}%{SPACE}%{TIME:time} %{WORD:taskid} \[%{WORD:instance name} -] %{WORD:status} %{INT:number1} messages %{GREEDYDATA}$"
Fourth line:
"^ %{NOTSPACE:date}%{SPACE}%{TIME:time} %{WORD:taskid} \[%{WORD:instance name} -] %{WORD:status} sending %{GREEDYDATA}$"
Match, the same as the first match.
I'm a bit unsure of how to do this, are the matches ordered?
So could I do it like this?
grok {
match => {
"message" => [
"^ %{NOTSPACE:date}%{SPACE}%{TIME:time} %{WORD:taskid} \[%{WORD:instance name} -] %{WORD:status} to send %{GREEDYDATA}$",
"^ %{NOTSPACE:date}%{SPACE}%{TIME:time} %{WORD:taskid} \[%{WORD:instance name} -] %{WORD:status} %{INT:number1} messages %{GREEDYDATA}$",
"^ %{NOTSPACE:date}%{SPACE}%{TIME:time} %{WORD:taskid} \[%{WORD:instance name} -] %{WORD:status} %{NOTSPACE} %{NOTSPACE} {INT:number2} seconds$",
"^ %{NOTSPACE:date}%{SPACE}%{TIME:time} %{WORD:taskid} \[%{WORD:instance name} -] %{WORD:status} sending %{GREEDYDATA}$"
]
}
}
I then created a special filebeat config to test this, and as I read that, I see 2 '_grokparsefailue' in the tags for each entry.
So as I understand it, it will enter a failed tag for each non-matching pattern???
Also, all the fieldnames I gave in the grok filter, are not showing up in the debug output?
What on earth is it I'm doing wrong?