{{ if eq .input "httpjson" }}

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

request.method: POST
{{ if .ssl }}

request.ssl: {{ .ssl | tojson }}
{{ end }}
request.url: {{ .url }}
#request.encode_as: application/x-www-form-encoded

request.transforms:
- set:
    target: header.Content-Type
    value: application/x-www-form-urlencoded
- set:
    target: url.params.query
    value: get_recent
- set:
    target: url.params.selector
    value: time

response.split:
  target: body.data

{{ 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.6.0
