-
Notifications
You must be signed in to change notification settings - Fork 436
/
Copy pathhttpjson.yml.hbs
65 lines (61 loc) · 1.35 KB
/
httpjson.yml.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
config_version: "2"
interval: {{interval}}
request.method: "GET"
{{#if enable_request_tracer}}
request.tracer.filename: "../../logs/httpjson/http-request-trace-*.ndjson"
request.tracer.maxbackups: 5
{{/if}}
{{#if url}}
request.url: {{url}}
{{/if}}
{{#if proxy_url }}
request.proxy_url: {{proxy_url}}
{{/if}}
{{#if ssl}}
request.ssl: {{ssl}}
{{/if}}
{{#if http_client_timeout}}
request.timeout: {{http_client_timeout}}
{{/if}}
request.transforms:
- set:
target: header.Content-Type
value: application/json
{{#if api_token }}
- set:
target: header.X-OTX-API-KEY
value: {{ api_token }}
{{/if}}
{{#if types}}
- set:
target: url.params.types
value: {{ types }}
{{/if}}
- set:
target: url.params.modified_since
value: '[[.cursor.timestamp]]'
default: '[[ formatDate (now (parseDuration "-{{ first_interval }}")) "RFC3339" ]]'
response.split:
target: body.results
keep_parent: true
response.pagination:
- set:
target: url.value
value: '[[ .last_response.body.next ]]'
cursor:
timestamp:
value: '[[ formatDate (now (parseDuration "-{{ lookback_range }}")) "RFC3339" ]]'
tags:
{{#if preserve_original_event}}
- preserve_original_event
{{/if}}
{{#each tags as |tag i|}}
- {{tag}}
{{/each}}
{{#contains "forwarded" tags}}
publisher_pipeline.disable_host: true
{{/contains}}
{{#if processors}}
processors:
{{processors}}
{{/if}}