forked from elastic/integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add third-party REST API (elastic#545)
* Add third-party REST API - apache - nginx - zeek - aws/cloudtrail
- Loading branch information
Showing
91 changed files
with
6,202 additions
and
11 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
packages/apache/data_stream/access/agent/stream/httpjson.yml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
config_version: "2" | ||
interval: {{interval}} | ||
auth.basic.user: {{username}} | ||
auth.basic.password: {{password}} | ||
cursor: | ||
index_earliest: | ||
value: '[[.last_event.result.max_indextime]]' | ||
request.url: {{url}}/services/search/jobs/export | ||
{{#if ssl}} | ||
request.ssl: {{ssl}} | ||
{{/if}} | ||
request.method: POST | ||
request.transforms: | ||
- set: | ||
target: url.params.search | ||
value: |- | ||
{{search}} | streamstats max(_indextime) AS max_indextime | ||
- set: | ||
target: url.params.output_mode | ||
value: "json" | ||
- set: | ||
target: url.params.index_earliest | ||
value: '[[ .cursor.index_earliest ]]' | ||
default: '[[(now (parseDuration "-{{interval}}")).Unix]]' | ||
- set: | ||
target: url.params.index_latest | ||
value: '[[(now).Unix]]' | ||
- set: | ||
target: header.Content-Type | ||
value: application/x-www-form-urlencoded | ||
response.decode_as: application/x-ndjson | ||
response.split: | ||
target: body.result._raw | ||
type: string | ||
delimiter: "\n" | ||
tags: | ||
{{#each tags as |tag i|}} | ||
- {{tag}} | ||
{{/each}} | ||
{{#contains tags "forwarded"}} | ||
publisher_pipeline.disable_host: true | ||
{{/contains}} | ||
processors: | ||
- decode_json_fields: | ||
fields: message | ||
target: json | ||
add_error_key: true | ||
- drop_event: | ||
when: | ||
not: | ||
has_fields: ['json.result'] | ||
- fingerprint: | ||
fields: | ||
- json.result._cd | ||
- json.result._indextime | ||
- json.result._raw | ||
- json.result._time | ||
- json.result.host | ||
- json.result.source | ||
target_field: "@metadata._id" | ||
- drop_fields: | ||
fields: message | ||
- rename: | ||
fields: | ||
- from: json.result._raw | ||
to: message | ||
- from: json.result.host | ||
to: host.name | ||
- from: json.result.source | ||
to: file.path | ||
ignore_missing: true | ||
fail_on_error: false | ||
- drop_fields: | ||
fields: json | ||
- add_fields: | ||
target: '' | ||
fields: | ||
ecs.version: 1.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
packages/apache/data_stream/error/agent/stream/httpjson.yml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
config_version: 2 | ||
interval: {{interval}} | ||
auth.basic.user: {{username}} | ||
auth.basic.password: {{password}} | ||
cursor: | ||
index_earliest: | ||
value: '[[.last_event.result.max_indextime]]' | ||
request.url: {{url}}/services/search/jobs/export | ||
{{#if ssl}} | ||
request.ssl: {{ssl}} | ||
{{/if}} | ||
request.method: POST | ||
request.transforms: | ||
- set: | ||
target: url.params.search | ||
value: |- | ||
{{search}} | streamstats max(_indextime) AS max_indextime | ||
- set: | ||
target: url.params.output_mode | ||
value: "json" | ||
- set: | ||
target: url.params.index_earliest | ||
value: '[[ .cursor.index_earliest ]]' | ||
default: '[[(now (parseDuration "-{{interval}}")).Unix]]' | ||
- set: | ||
target: url.params.index_latest | ||
value: '[[(now).Unix]]' | ||
- set: | ||
target: header.Content-Type | ||
value: application/x-www-form-urlencoded | ||
response.decode_as: application/x-ndjson | ||
response.split: | ||
target: body.result._raw | ||
type: string | ||
delimiter: "\n" | ||
tags: | ||
{{#each tags as |tag i|}} | ||
- {{tag}} | ||
{{/each}} | ||
{{#contains tags "forwarded"}} | ||
publisher_pipeline.disable_host: true | ||
{{/contains}} | ||
processors: | ||
- decode_json_fields: | ||
fields: message | ||
target: json | ||
add_error_key: true | ||
- drop_event: | ||
when: | ||
not: | ||
has_fields: ['json.result'] | ||
- fingerprint: | ||
fields: | ||
- json.result._cd | ||
- json.result._indextime | ||
- json.result._raw | ||
- json.result._time | ||
- json.result.host | ||
- json.result.source | ||
target_field: "@metadata._id" | ||
- drop_fields: | ||
fields: message | ||
- rename: | ||
fields: | ||
- from: json.result._raw | ||
to: message | ||
- from: json.result.host | ||
to: host.name | ||
- from: json.result.source | ||
to: file.path | ||
ignore_missing: true | ||
fail_on_error: false | ||
- drop_fields: | ||
fields: json | ||
- add_fields: | ||
target: '' | ||
fields: | ||
ecs.version: 1.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
packages/aws/data_stream/cloudtrail/agent/stream/httpjson.yml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
config_version: 2 | ||
interval: {{interval}} | ||
auth.basic.user: {{username}} | ||
auth.basic.password: {{password}} | ||
cursor: | ||
index_earliest: | ||
value: '[[.last_event.result.max_indextime]]' | ||
request.url: {{url}}/services/search/jobs/export | ||
{{#if ssl}} | ||
request.ssl: {{ssl}} | ||
{{/if}} | ||
request.method: POST | ||
request.transforms: | ||
- set: | ||
target: url.params.search | ||
value: {{search}} | streamstats max(_indextime) AS max_indextime | ||
- set: | ||
target: url.params.output_mode | ||
value: "json" | ||
- set: | ||
target: url.params.index_earliest | ||
value: '[[ .cursor.index_earliest ]]' | ||
default: '[[(now (parseDuration "-{{interval}}")).Unix]]' | ||
- set: | ||
target: url.params.index_latest | ||
value: '[[(now).Unix]]' | ||
- set: | ||
target: header.Content-Type | ||
value: application/x-www-form-urlencoded | ||
response.decode_as: application/x-ndjson | ||
response.split: | ||
target: body.result._raw | ||
type: string | ||
delimiter: "\n" | ||
{{#contains tags "forwarded"}} | ||
publisher_pipeline.disable_host: true | ||
{{/contains}} | ||
tags: | ||
{{#each tags as |tag i|}} | ||
- {{tag}} | ||
{{/each}} | ||
processors: | ||
- decode_json_fields: | ||
fields: message | ||
target: json | ||
add_error_key: true | ||
- drop_event: | ||
when: | ||
not: | ||
has_fields: ['json.result'] | ||
- fingerprint: | ||
fields: | ||
- json.result._cd | ||
- json.result._indextime | ||
- json.result._raw | ||
- json.result._time | ||
target_field: "@metadata._id" | ||
- drop_fields: | ||
fields: ["message"] | ||
- rename: | ||
fields: | ||
- from: json.result._raw | ||
to: message | ||
- drop_fields: | ||
fields: ["json"] | ||
ignore_missing: true | ||
- add_fields: | ||
target: '' | ||
fields: | ||
ecs.version: 1.8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.