generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 181
Add Frequently Used Big5 PPL Queries #4976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dai-chen
merged 19 commits into
opensearch-project:main
from
aalva500-prog:add-frequent-queries
Jan 6, 2026
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4c30c61
Add frequent used queries
noCharger 1297fa2
Add new queries to CalcitePPLBig5IT
noCharger 1f006db
Add frequently used Big5 PPL queries
aaarone90 5129270
Update integ-test/src/test/java/org/opensearch/sql/calcite/big5/Calci…
aalva500-prog 48d316a
Update integ-test/src/test/java/org/opensearch/sql/calcite/big5/Calci…
aalva500-prog c49e7e4
Update integ-test/src/test/java/org/opensearch/sql/calcite/big5/Calci…
aalva500-prog d052ba3
Update integ-test/src/test/java/org/opensearch/sql/calcite/big5/Calci…
aalva500-prog 08477f7
Addressing naming difference issues
aaarone90 1b1203a
Merge branch 'opensearch-project:main' into add-frequent-queries
aalva500-prog 237478a
Fixing formatting issues
aaarone90 cf4b1e0
Merge branch 'opensearch-project:main' into add-frequent-queries
aalva500-prog 9cc6f75
Fixing integration tests
aaarone90 edef39c
Removing dedup
aaarone90 fdc7e8e
Merge branch 'main' into add-frequent-queries
aalva500-prog 8dbb518
Adding comment to rex ppl file to explain what the query does
aaarone90 0bf2fb8
Adding comments to ppl queries to explain what they do
aaarone90 d6079b8
Fixing comments
aaarone90 3ed2ba6
Empty commit to trigger CI
aaarone90 c727124
Removing correctness check for rex command
aaarone90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| {"index":{}} | ||
| {"message":"2023-04-30T21:48:56.160Z Apr 30 21:48:56 ip-66-221-134-40 journal: donkey glazer fly shark whip servant thornfalcon","process":{"name":"journal"},"aws.cloudwatch":{"ingestion_time":"2023-04-30T21:48:56.160Z","log_group":"/var/log/messages","log_stream":"luckcrafter"},"tags":["preserve_original_event"],"meta":{"file":"2023-01-02/1682891301-gotext.ndjson.gz"},"cloud":{"region":"eu-central-1"},"@timestamp":"2023-01-02T22:02:34.000Z","input":{"type":"aws-cloudwatch"},"metrics":{"tmin":849,"size":1981},"log.file.path":"/var/log/messages/luckcrafter","event":{"id":"sunsetmark","dataset":"generic","ingested":"2023-07-20T03:36:30.223806Z"},"agent":{"id":"c315dc22-3ea6-44dc-8d56-fd02f675367b","name":"fancydancer","ephemeral_id":"c315dc22-3ea6-44dc-8d56-fd02f675367b","type":"filebeat","version":"8.8.0"}} | ||
| {"index":{}} | ||
| {"message":"2024-04-11T18:00:10.965Z Apr 11 18:00:10 ip-32-11-43-93 sshd: cloak bolt thorn hugger rib jackal wolverine shaker boar fighter taker boulderfox","process":{"name":"sshd"},"aws.cloudwatch":{"log_stream":"mirrorlighter","ingestion_time":"2024-04-11T18:00:10.965Z","log_group":"/var/log/messages"},"tags":["preserve_original_event"],"meta":{"file":"2024-04-11/1712851210-sshd.ndjson.gz"},"cloud":{"region":"ap-southeast-3"},"@timestamp":"2023-05-01T21:59:58.000Z","input":{"type":"aws-cloudwatch"},"metrics":{"size":3166,"tmin":1},"log.file.path":"/var/log/messages/mirrorlighter","event":{"id":"patternantler","ingested":"2024-04-11T17:39:10.965818973Z","dataset":"generic"},"agent":{"id":"c79a289f-6c16-4de2-a6c8-8ee5c84473d5","name":"brindlehugger","type":"filebeat","version":"8.8.0","ephemeral_id":"c79a289f-6c16-4de2-a6c8-8ee5c84473d5"}} | ||
| {"index":{}} | ||
| {"message":"2024-04-11T10:15:01.628Z Apr 11 10:15:01 ip-95-21-51-112 kernel: kicker stinger slave dolphin sparkox","process":{"name":"kernel"},"aws.cloudwatch":{"log_stream":"plumebard","ingestion_time":"2024-04-11T10:15:01.628Z","log_group":"/var/log/messages"},"tags":["preserve_original_event"],"meta":{"file":"2024-04-11/1712826901-kernel.ndjson.gz"},"cloud":{"region":"ap-south-1"},"@timestamp":"2023-03-01T22:31:11.000Z","input":{"type":"aws-cloudwatch"},"metrics":{"size":3993,"tmin":1},"log.file.path":"/var/log/messages/plumebard","event":{"id":"chipgambler","ingested":"2024-04-11T10:09:29.628941177Z","dataset":"generic"},"agent":{"id":"5f25fa16-6a99-489f-b1c5-f27c0627a459","name":"lemongrabber","type":"filebeat","version":"8.8.0","ephemeral_id":"5f25fa16-6a99-489f-b1c5-f27c0627a459"}} |
30 changes: 30 additions & 0 deletions
30
integ-test/src/test/resources/big5/queries/rex_regex_transformation.ppl
This file contains hidden or 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,30 @@ | ||
| /* Extract log type and filename from file paths, calculate filename length, and sort by timestamp */ | ||
| /* | ||
| { | ||
| "name": "rex_regex_transformation", | ||
| "operation-type": "search", | ||
| "index": "{{index_name | default('big5')}}", | ||
| "body": { | ||
| "query": { | ||
| "match_all": {} | ||
| }, | ||
| "_source": { | ||
| "includes": ["log.file.path", "@timestamp"], | ||
| "excludes": [] | ||
| }, | ||
| "sort": [ | ||
| { | ||
| "@timestamp": { | ||
| "order": "desc", | ||
| "missing": "_last" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| */ | ||
aalva500-prog marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| source = big5 | ||
| | rex field=log.file.path '/var/log/(?<logType>\\w+)/(?<filename>\\w+)' | ||
| | eval filename_len = length(filename) | ||
| | fields log.file.path, logType, filename, filename_len, @timestamp | ||
| | sort - @timestamp | ||
48 changes: 48 additions & 0 deletions
48
integ-test/src/test/resources/big5/queries/script_engine_like_pattern_with_aggregation.ppl
This file contains hidden or 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,48 @@ | ||
| /* Filter messages containing 'sshd' and aggregate count by metrics.size */ | ||
| /* | ||
| { | ||
| "name": "script_engine_like_pattern_with_aggregation", | ||
| "operation-type": "search", | ||
| "index": "{{index_name | default('custom-big5')}}", | ||
| "body": { | ||
| "query": { | ||
| "script": { | ||
| "script": { | ||
| "source": "{\"langType\":\"calcite\",\"script\":\"...\"}", | ||
| "lang": "opensearch_compounded_script", | ||
| "params": { | ||
| "utcTimestamp": "{{current_timestamp}}" | ||
| } | ||
| }, | ||
| "boost": 1.0 | ||
| } | ||
| }, | ||
| "_source": { | ||
| "includes": ["message", "metrics.size"], | ||
| "excludes": [] | ||
| }, | ||
| "aggregations": { | ||
| "composite_buckets": { | ||
| "composite": { | ||
| "size": 10000, | ||
| "sources": [ | ||
| { | ||
| "metrics.size": { | ||
| "terms": { | ||
| "field": "metrics.size", | ||
| "missing_bucket": true, | ||
| "missing_order": "first", | ||
| "order": "asc" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| */ | ||
| source = big5 | ||
| | where like(`message`, '%sshd%') | ||
| | stats count() by metrics.size |
39 changes: 39 additions & 0 deletions
39
integ-test/src/test/resources/big5/queries/script_engine_like_pattern_with_sort.ppl
This file contains hidden or 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,39 @@ | ||
| /* Filter messages containing 'sshd', sort by timestamp, and return top 10 results */ | ||
| /* | ||
| { | ||
| "name": "script_engine_like_pattern_with_sort", | ||
| "operation-type": "search", | ||
| "index": "{{index_name | default('big5')}}", | ||
| "body": { | ||
| "query": { | ||
| "script": { | ||
| "script": { | ||
| "source": "{\"langType\":\"calcite\",\"script\":\"...\"}", | ||
| "lang": "opensearch_compounded_script", | ||
| "params": { | ||
| "utcTimestamp": "{{current_timestamp}}" | ||
| } | ||
| }, | ||
| "boost": 1.0 | ||
| } | ||
| }, | ||
| "size": 10, | ||
| "_source": { | ||
| "includes": ["agent", "process", "log", "message", "tags", "cloud", "input", "@timestamp", "ecs", "data_stream", "meta", "host", "metrics", "aws", "event"], | ||
| "excludes": [] | ||
| }, | ||
| "sort": [ | ||
| { | ||
| "@timestamp": { | ||
| "order": "desc", | ||
| "missing": "_last" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| */ | ||
| source = big5 | ||
| | where like(`message`, '%sshd%') | ||
| | sort - @timestamp | ||
| | head 10 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.