How to extract logstash log.file.path for filter

hi.
I am using Filebeat and Logstash.

now, my [log][file][path] result. (The file path is flexible.)

/home/logs/tomcat/application/test.log

or

/LOG/application/test2.log

etc...

I only want the file name except for the extension.
example,

test

or

test2

I want to use the extracted file name as the output elasticsearch index by putting it in a variable.
please help me...

You can use a grok filter with this regex:

(?<filename>[^\/]*)\.log$

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