{{ if eq .input "httpjson" }}

type: httpjson

{{ if .api_key }}
api_key: {{ .api_key }}
{{ end }}

authentication_scheme: {{ .authentication_scheme }}

{{ if .http_client_timeout }}
http_client_timeout: {{ .http_client_timeout }}
{{ end }}

{{ if .http_method }}
http_method: {{ .http_method }}
{{ end }}

{{ if .http_headers }}
http_headers: {{ .http_headers | tojson }}
{{ end }}

{{ if .http_request_body }}
http_request_body: {{ .http_request_body }}
{{ end }}

interval: {{ .interval }}

{{ if .json_objects_array }}
json_objects_array: {{ .json_objects_array }}
{{ end }}

no_http_body: {{ .no_http_body }}

pagination: {{ .pagination | tojson }}

rate_limit: {{ .rate_limit | tojson }}

{{ if .ssl }}
ssl: {{ .ssl | tojson }}
{{ end }}

{{ if .url }}
url: {{ .url }}
{{ end }}

date_cursor.field: published
date_cursor.url_field: since
date_cursor.initial_interval: {{ .initial_interval }}

{{ 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:
  - script:
      lang: javascript
      id: okta_system_script
      file: ${path.home}/module/okta/system/config/pipeline.js
      params:
        keep_original_message: {{ .keep_original_message }}
  - add_fields:
      target: ''
      fields:
        ecs.version: 1.5.0
