{{ if eq .input "cometd" }}

type: cometd
channel_name: /event/LoginEventStream
auth.oauth2:
  {{ if .client_id }}
  client.id: {{ .client_id }}
  {{ end }}
  {{ if .client_secret }}
  client.secret: {{ .client_secret }}
  {{ end }}
  {{ if .token_url }}
  token_url: {{ .token_url }}
  {{ end }}
  {{ if .user }}
  user: {{ .user }}
  {{ end }}
  {{ if .password }}
  password: {{ .password }}
  {{ end }}

{{ else if eq .input "file" }}

type: log
paths:
{{ range $i, $path := .paths }}
  - {{$path}}
{{ end }}
exclude_files: [".gz$"]

{{ end }}

tags: {{.tags | tojson}}
publisher_pipeline.disable_host: {{ inList .tags "forwarded" }}

processors:
  - decode_json_fields:
      fields: [message]
      target: "json"
  - add_fields:
      target: ''
      fields:
        ecs.version: 1.12.0
  - add_locale: ~
