Need to fetch only selected data from Grok filter

Sample Log : 2020-12-16T04:43:43Z Bitcoin Core version v0.20.1.0-g7ff64311bee570874c4f0dfa18f518552188df08 (release build)

I want to get the only version(v0.20.1.0) from the above log,

Note : version string is a whole word v0.20.1.0-g7ff64311bee570874c4f0dfa18f518552188df08 and I required only v0.20.1.0.

can anybody help me with what I should write in grok pattern :question:

Use grok filter in logstash

filter {
      grok {
        match => { "message" =>" .* version %{NOTSPACE:version}-.*" }
      }
}
1 Like

@tatdat Thanks a lot :slightly_smiling_face:

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