-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert ingest processor supports ip type (#12818)
* Convert ingest processor supports ip type Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Modify change log Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Add comment Signed-off-by: Gao Binlong <gbinlong@amazon.com> --------- Signed-off-by: Gao Binlong <gbinlong@amazon.com>
- Loading branch information
1 parent
618782d
commit 8d5a1d2
Showing
4 changed files
with
123 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
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
83 changes: 83 additions & 0 deletions
83
...est-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/330_convert_processor.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,83 @@ | ||
--- | ||
teardown: | ||
- do: | ||
ingest.delete_pipeline: | ||
id: "1" | ||
ignore: 404 | ||
|
||
--- | ||
"Test convert processor with ip type": | ||
- skip: | ||
version: " - 2.13.99" | ||
reason: "introduced in 2.14.0" | ||
- do: | ||
ingest.put_pipeline: | ||
id: "1" | ||
body: > | ||
{ | ||
"processors": [ | ||
{ | ||
"convert" : { | ||
"field" : "raw_ip", | ||
"type": "ip" | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
catch: /\[1.1.1.\] is not a valid ipv4\/ipv6 address/ | ||
index: | ||
index: test | ||
id: 1 | ||
pipeline: "1" | ||
body: { | ||
raw_ip: "1.1.1." | ||
} | ||
|
||
- do: | ||
ingest.put_pipeline: | ||
id: "1" | ||
body: > | ||
{ | ||
"processors": [ | ||
{ | ||
"convert" : { | ||
"field" : "raw_ip", | ||
"target_field" : "ip_field", | ||
"type" : "ip", | ||
"ignore_failure" : true | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: 1 | ||
pipeline: "1" | ||
body: { | ||
raw_ip: "1.1.1." | ||
} | ||
- do: | ||
get: | ||
index: test | ||
id: 1 | ||
- match: { _source: { raw_ip: "1.1.1."} } | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: 1 | ||
pipeline: "1" | ||
body: { | ||
raw_ip: "1.1.1.1" | ||
} | ||
- do: | ||
get: | ||
index: test | ||
id: 1 | ||
- match: { _source: { raw_ip: "1.1.1.1", ip_field: "1.1.1.1"} } |