How to create filter for strings with separator and calculate string?

I have a simple config file:

input {
  file{
    path => "/tmp/data_for_logstach"
    start_position => "beginning"
    }
}
filter {
}
output {
  file{
    path => "/tmp/logstash_convert"
    action => "update"
  }
}

How can I filter the log file with the following content?

2022-07-19 16:39:01.238595 [115454] SEND CHNL     3 ('127.0.0.1')     SBM    
2022-07-19 16:39:01.248937 [115454] RECV CHNL     3 ('127.0.0.1')     SBM_RSP
2022-07-19 16:39:01.314584 [115454] RECV CHNL    51 ('127.0.0.1')     SBM_RSP
2022-07-19 16:39:01.328134 [115454] RECV CHNL     3 ('127.0.0.1')     SBM    
2022-07-19 16:39:01.330623 [115454] SEND CHNL     3 ('127.0.0.1')     SBM_RSP
2022-07-19 16:39:01.456351 [115454] RECV CHNL  1465 ('127.0.0.1')     DLV

The result that I expect to get:

command:SBM id:3 count:2
command:SBM_RSP id:3 count:2
command:SBM_RSP id:51 count:1
command:DLV id:1465 count:1

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.