-
Notifications
You must be signed in to change notification settings - Fork 69
Squash merge temp into temp-parser #658
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| filter { | ||
| mutate { | ||
| replace => { | ||
| "event_data" => "" | ||
| "productlogid" => "" | ||
| "kv_msg" => "" | ||
| "msg" => "" | ||
| "deviceCustomDate1" => "" | ||
| "rt" => "" | ||
| } | ||
| } | ||
|
|
||
| grok { | ||
| match => { | ||
| "message" => [ | ||
| "%{GREEDYDATA:event_data} \\| %{GREEDYDATA:kv_msg}" | ||
| ] | ||
| } | ||
| overwrite => ["event_data" ,"msg" ,"kv_msg"] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The field References
|
||
| on_error => "grok_failure" | ||
| } | ||
|
|
||
| mutate { | ||
| gsub => ["kv_msg", " ([a-zA-Z0-9]+=)","#$1"] | ||
| } | ||
|
|
||
| kv { | ||
| source => "kv_msg" | ||
| field_split => "#" | ||
| value_split => "=" | ||
| on_error => "kv_failure" | ||
| } | ||
|
|
||
| mutate { | ||
| replace => { | ||
| "event_type" => "GENERIC_EVENT" | ||
| } | ||
| } | ||
|
|
||
| if [msg] != "" { | ||
| mutate { | ||
| replace => { | ||
| "msg_label.value.string_value" => "%{msg}" | ||
| } | ||
| on_error => "msg_empty" | ||
| } | ||
| if ![msg_empty] { | ||
| mutate { | ||
| replace => { | ||
| "msg_label.key" => "msg" | ||
| } | ||
| } | ||
| mutate { | ||
| merge => { | ||
| "event.idm.read_only_udm.additional.fields" => "msg_label" | ||
| } | ||
| on_error => "msg_label_empty" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if [event_data] != "" { | ||
| mutate { | ||
| replace => { | ||
| "event.idm.read_only_udm.metadata.description" => "%{event_data}" | ||
| } | ||
| on_error => "event_data_empty" | ||
| } | ||
| } | ||
|
|
||
| mutate { | ||
| rename => { | ||
| "event_type" => "event.idm.read_only_udm.metadata.event_type" | ||
| } | ||
| } | ||
|
|
||
| mutate { | ||
| merge => { | ||
| "@output" => "event" | ||
| } | ||
| } | ||
|
|
||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "product": "DUMMY Product", | ||
| "vendor": "Test Vendor", | ||
| "description": "Some sort of product from this vendorr.", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "log_type": "DUMMY_LOGTYPE", | ||
| "verified": true | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "events": [ | ||
| { | ||
| "event" : { | ||
| "timestamp": "2021-03-23T08:20:27.863384Z", | ||
| "idm": { | ||
| "read_only_udm": { | ||
| "metadata": { | ||
| "event_timestamp": "2021-03-23T08:20:27.863384Z", | ||
| "event_type": "GENERIC_EVENT", | ||
| "description": "No New Ingestion Activity" | ||
| }, | ||
| "additional": { | ||
| "msg": "No reports have been ingested since MAR 23 2021 00:18:31." | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "event" : { | ||
| "timestamp": "2021-03-23T08:20:27.863384Z", | ||
| "idm": { | ||
| "read_only_udm": { | ||
| "metadata": { | ||
| "event_timestamp": "2021-03-23T08:20:27.863384Z", | ||
| "event_type": "GENERIC_EVENT", | ||
| "description": "No New Ingestion Activity" | ||
| }, | ||
| "additional": { | ||
| "msg": "No reports have been ingested since MAR 23 2021 00:18:32." | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "events": [ | ||
| { | ||
| "event" : { | ||
| "timestamp": "2021-03-23T08:20:27.863384Z", | ||
| "idm": { | ||
| "read_only_udm": { | ||
| "metadata": { | ||
| "event_timestamp": "2021-03-23T08:20:27.863384Z", | ||
| "event_type": "GENERIC_EVENT", | ||
| "description": "No New Ingestion Activity" | ||
| }, | ||
| "additional": { | ||
| "msg": "No reports have been ingested since MAR 23 2021 00:18:31." | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "event" : { | ||
| "timestamp": "2021-03-23T08:20:27.863384Z", | ||
| "idm": { | ||
| "read_only_udm": { | ||
| "metadata": { | ||
| "event_timestamp": "2021-03-23T08:20:27.863384Z", | ||
| "event_type": "GENERIC_EVENT", | ||
| "description": "No New Ingestion Activity" | ||
| }, | ||
| "additional": { | ||
| "msg": "No reports have been ingested since MAR 23 2021 00:18:32." | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "raw_logs": [ | ||
| "No New Ingestion Activity | msg=No reports have been ingested since MAR 23 2021 00:18:31.", | ||
| "No New Ingestion Activity | msg=No reports have been ingested since MAR 23 2021 00:18:32." | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "raw_logs": [ | ||
| "No New Ingestion Activity | msg=No reports have been ingested since MAR 23 2021 00:18:31.", | ||
| "No New Ingestion Activity | msg=No reports have been ingested since MAR 23 2021 00:18:32." | ||
| ] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fields
productlogid,deviceCustomDate1, andrtare initialized but never used or populated in the parser logic. Removing unused initializations improves code clarity and maintainability.References