Sherabu
(Aherabu)
August 20, 2021, 5:32pm
1
Hi bro and sis
I will be sending file from filebeat to logstash. Is there a way I can extract file name on logstash filter? I want to add as a new field
My file name
Path/sample.log
Path/sample.20210821
Your small advice and example is big help to me
Badger
August 21, 2021, 4:21pm
2
There are many ways to do this. See here and here for examples.
Sherabu
(Aherabu)
August 21, 2021, 5:30pm
3
I tried as below
```
filter {
grok {
match => ["path","%{GREEDYDATA}/%{GREEDYDATA:filename}\.log"]
}
}
```
But in filename field it giving .log .how to have only name without extension?
system
(system)
Closed
September 18, 2021, 5:31pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.