  filelog/{{ name|default('tomcat-log') }}:
    include:
      - {{ filename|default('/var/log/tomcat/*.log') }}
    include_file_path: true
    operators:
      - type: regex_parser
        regex: '^(?P<ts>\d{2}-\w{3}-\d{4}\s\d{2}:\d{2}:\d{2}.\d{3})\s(?P<level>\w+) \[(?P<component>[^]]+)\]\s(?P<class>[\w\.\d]+)\s(?P<body>.*)$'
        timestamp:
          parse_from: attributes.ts
          layout: '%d-%b-%Y %H:%M:%S.%L'
        severity:
          parse_from: attributes.level
      - type: move
        from: attributes["body"]
        to: body
      # Add a service version, the template version
      - type: add
        field: resource["service.version"]
        value: '1.0.0'
      # Add the service name
      - type: add
        field: resource["service.name"]
        value: 'tomcat'
      - type: remove
        field: attributes["ts"]
      - type: remove
        field: attributes["level"]
      - type: move
        to: attributes["code.function.name"]
        from: attributes["class"]
