-
Notifications
You must be signed in to change notification settings - Fork 462
/
Copy pathhttpjson.yml.hbs
40 lines (40 loc) · 1.24 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
config_version: 2
interval: {{interval}}
{{#if enable_request_tracer}}
request.tracer.filename: "../../logs/httpjson/http-request-trace-*.ndjson"
request.tracer.maxbackups: 5
{{/if}}
request.method: GET
request.url: {{hostname}}/admin/v1/logs/administrator
request.rate_limit.limit: "{{rate_limit}}"
request.transforms:
- set:
target: url.params.mintime
value: '[[.cursor.last_published]]'
default: '[[(now (parseDuration "-{{interval}}")).Unix]]'
- set:
target: header.Date
value: '[[formatDate (now) "Mon, 02 Jan 2006 15:04:05 -0700"]]'
- set:
target: header.Authorization
value: '[[sprintf "Basic %s" (base64Encode (sprintf "%s:%s" "{{integration_key}}" (hmac "sha1" "{{secret_key}}" (formatDate (now) "Mon, 02 Jan 2006 15:04:05 -0700") "\n" "GET" "\n" .url.Host "\n" "/admin/v1/logs/administrator" "\n" .url.RawQuery)))]]'
response.split:
target: body.response
ignore_empty_value: true
cursor:
last_published:
value: '[[toInt .last_event.timestamp]]'
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}}