Extracting fields from path and adding them to new elapsed events

Hi all,
I have files stored as follows:
c: /..../ agency / device / log.txt
I want to extract the fields of agency and the device and add them to each event in the log.
Now I'm doing this using a grok filter, and it does work well for all the events in the log, but I want these fields to be added to new elapsed events created, and I'm necessarily interested in creating a new event.

This is how my log looks right now:
grok {
match => {path => "%{GREEDYDATA}/%{GREEDYDATA:agency}/ {GREEDYDATA:device}/%{GREEDYDATA}.txt"}
start_tag => "a"
end_tag => "b"
unique_id_field => "host"
timeout => 100000
new_event_on_match => true
add_tag => "ab"

Is there any way to do that?
Thank you!

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