Tag logs files from different directories

Hi,

I have the same kind of log file that uses the same grok patterns to match, however they are in different folders and I want to tag them accordingly. How would I go about it?

Would something like this work:

    filebeat.inputs:
    - type: log
      enabled: true

      paths:
        - /opt/IBM/WebSphere/server_one/SystemOut.log
      tags: ["server_one"]
        
      paths:
        - /opt/IBM/WebSphere/server_two/SystemOut.log
      tags: ["server_two"]

Did you try to split them into multiple type: log entries? Your configuration seems to be incorrect as paths and tags are getting overwritten (YAML format).

Ok, so more like this:

    filebeat.inputs:
    - type: log
      enabled: true

      paths:
        - /opt/IBM/WebSphere/server_one/SystemOut.log
      tags: ["server_one"]

    - type: log
      enabled: true        
      paths:
        - /opt/IBM/WebSphere/server_two/SystemOut.log
      tags: ["server_two"]

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