Hi,
I am looking for advise on how to use the processor-> dissect within Filebeat for a log file. Below is an example of the log file date:
[08/10/2020 09:31:57] servername - Processor Queue Ok 3 WMI (localhost:ProcessorQueueLength) 4890
[08/10/2020 09:32:25] servername - HTTP Connections Spiking Bad 5.00 Perf Counter test (Current Connections) 4828
[08/10/2020 09:32:30] servername - HTTP Connections Spiking Bad 8.00 Perf Counter test (Current Connections) 4871
[08/10/2020 09:32:38] servername - HTTP Connections Spiking Bad 13.00 Perf Counter test (Current Connections) 4926
[08/10/2020 09:32:43] servername - Processor Queue Bad 7 WMI (localhost:ProcessorQueueLength) 3473
[08/10/2020 09:32:57] servername - Processor Queue Bad 8 WMI (localhost:ProcessorQueueLength) 4893
[08/10/2020 09:32:57] servername - Processor Queue Bad 37 WMI (localhost:ProcessorQueueLength) 4902
[08/10/2020 09:33:00] servername - HTTP Connections Spiking Ok 7.00 Perf Counter test (Current Connections) 4828
[08/10/2020 09:33:02] servername - HTTP Connections Spiking Ok 9.00 Perf Counter test (Current Connections) 4871
[08/10/2020 09:33:11] servername - HTTP Connections Spiking Ok 18.00 Perf Counter test (Current Connections) 4926
[08/10/2020 09:33:53] servername - Processor Percentage Bad 100 % CPU Usage 4881
[08/10/2020 09:33:59] servername - Processor Queue Ok 1 WMI (localhost:ProcessorQueueLength) 4902
[08/10/2020 09:33:59] servername - Processor Queue Ok 4 WMI (localhost:ProcessorQueueLength) 4893
I want to update take the message and update the fields, to timestamp, hostname, test, status, reply, testmethod. This is what I currently have in my filebeat.yml file:
- type: log
enabled: true
paths:
- C:\ProgramData\Monitor\Logs\*.txt
processors:
- dissect:
tokenizer: '%{timestamp|integer} %{hostname} - %{test} %{status} %{reply} %{testmethod}'
field: "message"
If possible I would also like it to drop the events which are 'OK', and only collect 'Bad' logs.
thanks in advance
Ian