Get specific string from field in logstash

Hello, I'm new to logstash and I'm having trouble with this.
I configured filebeat to receive Nginx log:
This is sample input:

  "log": {
    "offset": 2234788,
    "file": {
      "path": "/nginxlogs/"

the path could be *.error.log
I need to get the string "" from the path. Can anyone help me with this?
Thank you very much

I hope that I got your request right?

grok {
  match => { "[log][file][path]" => ".*\/(?<yourstring>.+)\.(error|access)\.log$"}

You can use a ruby filter

ruby {
   code => " 

It will be stored in ngnixname field

Thanks, this match is working with my string but how can I separate "" into my field

This work first try. Thank you very much :smile:

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