{{ if eq .input "httpjson" }}

type: httpjson
config_version: "2"
interval: {{ .interval }}

request.method: GET
{{ if .ssl }}
request.ssl: {{ .ssl | tojson }}
{{ end }}
{{ if .proxy_url }}
request.proxy_url: {{ .proxy_url }}
{{ end }}
request.url: {{ .url }}
request.transforms:
- set:
    target: header.Content-Type
    value: application/json

response.split:
  target: body.payloads

{{ 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
  - fingerprint:
      fields: ["json.md5_hash"]
      target_field: "@metadata._id"
  - add_fields:
      target: ''
      fields:
        ecs.version: 1.9.0
