type: log
paths:
{{ range $i, $path := .paths }}
 - {{$path}}
{{ end }}
exclude_files: [".gz$"]
tags: {{.tags | tojson}}
publisher_pipeline.disable_host: {{ inList .tags "forwarded" }}

json.keys_under_root: false

fields_under_root: true
fields:
  network.protocol: syslog

processors:
  - rename:
      fields:
        - from: "json"
          to: "zeek.syslog"

        - from: "zeek.syslog.id.orig_h"
          to: "source.address"

        - from: "zeek.syslog.id.orig_p"
          to: "source.port"

        - from: "zeek.syslog.id.resp_h"
          to: "destination.address"

        - from: "zeek.syslog.id.resp_p"
          to: "destination.port"

        - from: "zeek.syslog.uid"
          to: "zeek.session_id"

        - from: "zeek.syslog.proto"
          to: "network.transport"

        - from: "zeek.syslog.message"
          to: "zeek.syslog.msg"

      ignore_missing: true
      fail_on_error: false
  - convert:
      fields:
        - {from: "zeek.session_id", to: "event.id"}
        - {from: "source.address", to: "source.ip", type: "ip"}
        - {from: "destination.address", to: "destination.ip", type: "ip"}
        - {from: "zeek.syslog.facility", to: "log.syslog.facility.name"}
        - {from: "zeek.syslog.severity", to: "log.syslog.severity.name"}
  - add_fields:
      target: event
      fields:
        kind: event
  - community_id:
  - add_fields:
      target: ''
      fields:
        ecs.version: 1.5.0
