-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding tests for multiple pipeline loading, including rollback
- Loading branch information
1 parent
0a10ae2
commit c5cb4d7
Showing
12 changed files
with
232 additions
and
0 deletions.
There are no files selected for viewing
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,8 @@ | ||
- module: foo | ||
# Fileset with multiple pipelines | ||
multi: | ||
enabled: true | ||
|
||
# Fileset with multiple pipelines with the last one being bad | ||
multibad: | ||
enabled: true |
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,8 @@ | ||
type: log | ||
paths: | ||
- /tmp | ||
exclude_files: [".gz$"] | ||
|
||
fields: | ||
service.name: "foo" | ||
fields_under_root: true |
10 changes: 10 additions & 0 deletions
10
filebeat/_meta/test/module/foo/multi/ingest/json_logs.json
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,10 @@ | ||
{ | ||
"processors": [ | ||
{ | ||
"rename": { | ||
"field": "json", | ||
"target_field": "log.meta" | ||
} | ||
} | ||
] | ||
} |
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,27 @@ | ||
{ | ||
"processors": [ | ||
{ | ||
"grok": { | ||
"field": "message", | ||
"patterns": [ | ||
"^%{CHAR:first_char}" | ||
], | ||
"pattern_definitions": { | ||
"CHAR": "." | ||
} | ||
} | ||
}, | ||
{ | ||
"pipeline": { | ||
"if": "ctx.first_char == '{'", | ||
"name": "{< IngestPipeline "json_logs" >}" | ||
} | ||
}, | ||
{ | ||
"pipeline": { | ||
"if": "ctx.first_char != '{'", | ||
"name": "{< IngestPipeline "plain_logs" >}" | ||
} | ||
} | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
filebeat/_meta/test/module/foo/multi/ingest/plain_logs.json
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,12 @@ | ||
{ | ||
"processors": [ | ||
{ | ||
"grok": { | ||
"field": "message", | ||
"patterns": [ | ||
"^%{DATA:some_data}" | ||
] | ||
} | ||
} | ||
] | ||
} |
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,8 @@ | ||
module_version: 1.0 | ||
|
||
ingest_pipeline: | ||
- ingest/pipeline.json | ||
- ingest/json_logs.json | ||
- ingest/plain_logs.json | ||
|
||
input: config/multi.yml |
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,8 @@ | ||
type: log | ||
paths: | ||
- /tmp | ||
exclude_files: [".gz$"] | ||
|
||
fields: | ||
service.name: "foo" | ||
fields_under_root: true |
10 changes: 10 additions & 0 deletions
10
filebeat/_meta/test/module/foo/multibad/ingest/json_logs.json
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,10 @@ | ||
{ | ||
"processors": [ | ||
{ | ||
"rename": { | ||
"field": "json", | ||
"target_field": "log.meta" | ||
} | ||
} | ||
] | ||
} |
27 changes: 27 additions & 0 deletions
27
filebeat/_meta/test/module/foo/multibad/ingest/pipeline.json
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,27 @@ | ||
{ | ||
"processors": [ | ||
{ | ||
"grok": { | ||
"field": "message", | ||
"patterns": [ | ||
"^%{CHAR:first_char}" | ||
], | ||
"pattern_definitions": { | ||
"CHAR": "." | ||
} | ||
} | ||
}, | ||
{ | ||
"pipeline": { | ||
"if": "ctx.first_char == '{'", | ||
"name": "{< IngestPipeline "json_logs" >}" | ||
} | ||
}, | ||
{ | ||
"pipeline": { | ||
"if": "ctx.first_char != '{'", | ||
"name": "{< IngestPipeline "plain_logs" >}" | ||
} | ||
} | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
filebeat/_meta/test/module/foo/multibad/ingest/plain_logs_bad.json
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,12 @@ | ||
{ | ||
"processors": [ | ||
{ | ||
"invalid_processor": { | ||
"field": "message", | ||
"patterns": [ | ||
"^%{DATA:some_data}" | ||
] | ||
} | ||
} | ||
] | ||
} |
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,8 @@ | ||
module_version: 1.0 | ||
|
||
ingest_pipeline: | ||
- ingest/pipeline.json | ||
- ingest/json_logs.json | ||
- ingest/plain_logs_bad.json | ||
|
||
input: config/multi.yml |
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