-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support regex tags search for Elasticseach backend (#2049)
* Add regex tag filter for ES backend Signed-off-by: Annanay <[email protected]> * [ES] Add support to check for presence of a tag Signed-off-by: Annanay <[email protected]> * Revert "[ES] Add support to check for presence of a tag" This reverts commit f94c220. Signed-off-by: Annanay <[email protected]> * Add query builder and integration tests Signed-off-by: Annanay <[email protected]> * Fix tests Signed-off-by: Annanay <[email protected]> * Add ES specific integration tests Signed-off-by: Annanay <[email protected]> * Improve tag search tests Signed-off-by: Annanay <[email protected]> * Nit, clean function params Signed-off-by: Annanay <[email protected]>
- Loading branch information
Showing
12 changed files
with
407 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
"bool":{ | ||
"should":[ | ||
{ | ||
"bool":{ | ||
"must":{ | ||
"regexp":{ | ||
"tag.bat@foo":{ | ||
"value":"spo.*" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"bool":{ | ||
"must":{ | ||
"regexp":{ | ||
"process.tag.bat@foo":{ | ||
"value":"spo.*" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"tags", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"tags.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"tags.value":{ | ||
"value":"spo.*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"process.tags", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"process.tags.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"process.tags.value":{ | ||
"value":"spo.*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"logs.fields", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"logs.fields.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"logs.fields.value":{ | ||
"value":"spo.*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
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,103 @@ | ||
{ | ||
"bool":{ | ||
"should":[ | ||
{ | ||
"bool":{ | ||
"must":{ | ||
"regexp":{ | ||
"tag.bat@foo":{ | ||
"value":"spo\\*" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"bool":{ | ||
"must":{ | ||
"regexp":{ | ||
"process.tag.bat@foo":{ | ||
"value":"spo\\*" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"tags", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"tags.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"tags.value":{ | ||
"value":"spo\\*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"process.tags", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"process.tags.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"process.tags.value":{ | ||
"value":"spo\\*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"nested":{ | ||
"path":"logs.fields", | ||
"query":{ | ||
"bool":{ | ||
"must":[ | ||
{ | ||
"match":{ | ||
"logs.fields.key":{ | ||
"query":"bat.foo" | ||
} | ||
} | ||
}, | ||
{ | ||
"regexp":{ | ||
"logs.fields.value":{ | ||
"value":"spo\\*" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
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
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,34 @@ | ||
[ | ||
{ | ||
"Caption": "Tag escaped operator + Operation name + max Duration", | ||
"Query": { | ||
"ServiceName": "query23-service", | ||
"OperationName": "query23-operation", | ||
"Tags": { | ||
"sameplacetag1":"same\\*" | ||
}, | ||
"StartTimeMin": "2017-01-26T15:46:31.639875Z", | ||
"StartTimeMax": "2017-01-26T17:46:31.639875Z", | ||
"DurationMin": 0, | ||
"DurationMax": 1000, | ||
"NumTraces": 1000 | ||
}, | ||
"ExpectedFixtures": ["tags_escaped_operator_trace_1"] | ||
}, | ||
{ | ||
"Caption": "Tag wildcard regex", | ||
"Query": { | ||
"ServiceName": "query24-service", | ||
"OperationName": "", | ||
"Tags": { | ||
"sameplacetag1":"same.*" | ||
}, | ||
"StartTimeMin": "2017-01-26T15:46:31.639875Z", | ||
"StartTimeMax": "2017-01-26T17:46:31.639875Z", | ||
"DurationMin": 0, | ||
"DurationMax": 0, | ||
"NumTraces": 1000 | ||
}, | ||
"ExpectedFixtures": ["tags_wildcard_regex_1", "tags_wildcard_regex_2"] | ||
} | ||
] |
Oops, something went wrong.