{{ if eq .input "httpjson" }}

type: httpjson
api_key: {{ .api_key }}
http_client_timeout: {{ .http_client_timeout }}
http_method: {{ .http_method }}
http_headers: {{ .http_headers }}
http_request_body: {{ .http_request_body }}
interval: {{ .interval }}
json_objects_array: {{ .json_objects_array }}
pagination: {{ .pagination }}
url: {{ .url }}
ssl: {{ .ssl }}

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

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

{{ end }}

processors:
  - script:
      lang: javascript
      id: misp_script
      file: ${path.home}/module/misp/threat/config/pipeline.js
  - timestamp:
      field: json.timestamp
      layouts:
        - UNIX
  - drop_fields:
      fields: [json]
  - add_fields:
      target: ''
      fields:
        ecs.version: 1.5.0
