Using filebeat and add job name

I have the below log structure of jobs:
/job1/datetoday.log
/job2/datetoday.log
and so on.

Can file beat be used to grep the error in logs and add Job name string to that error log fetched before indexing to ES so that in kibana I can search the log by job name.

I need help mainly for adding job name file to each grep'd error. It would be something like this:
Job1 Error.....
Job1 Error...
Job2 Error
Job3 Error and so on.

The job name has to be fetched from the folder structure for writing. Please help

Hi @Divit_Sharma,

Source path is sent as part of the event, in the source field. This can already be used to search by this name.
In any case you can modify events with an ingest pipeline, with this you could parse the source field to extract the name of the job from the log file path, and then adding it as a new field that you can then use to filter events in Kibana.

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