You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Problem
I have Juniper-structured syslog messages in the following format:
"message": "<28>1 2025-02-25T19:46:40.887Z mx204-lab R6_RR_MPLS_LAB:rpd 23152 RPD_BGP_NEIGHBOR_STATE_CHANGED [[email protected] peer-name=\"10.11.11.68 (Internal AS 65545)\" old-state=\"OpenConfirm\" new-state=\"Established\" event-type=\"RecvKeepAlive\" instance=\"master\"] BGP peer 10.11.11.68 (Internal AS 65555) changed state from OpenConfirm to Established (event RecvKeepAlive) (instance master)"
Vector correctly parses the log using parse_syslog. However, I want to rename the key "[email protected]" to "junos_event_tags" using the following transformation:
.junos_event_tags = del(."[email protected]") # Rename
This works as expected in the Vector Playground, but when applied inside Vector, the transformation does not take effect. As a result, OpenSearch still receives the original key name, such as "[email protected]".
This is the VRL code .message = string!(.message) if (match(.message, r'.*[email protected]')) { . |= parse_syslog!(.message) .junos_event_tags = del(."[email protected]") # rename }
Below is the output from the Playground:
{ "appname": "R6_RR_MPLS_LAB:rpd", "facility": "daemon", "hostname": "mx204-lab", "[email protected]": { "event-type": "RecvKeepAlive", "instance": "master", "new-state": "Established", "old-state": "OpenConfirm", "peer-name": "10.11.11.68 (Internal AS 65545)" }, "message": "BGP peer 10.11.11.68 (Internal AS 65555) changed state from OpenConfirm to Established (event RecvKeepAlive) (instance master)", "msgid": "RPD_BGP_NEIGHBOR_STATE_CHANGED", "procid": 23152, "severity": "warning", "timestamp": "2025-02-25T19:46:40.887Z", "version": 1 }
Hi @nitzan-tz, can you share the playground link please? Keep in mind that some vector events might have different shape and the path might not have a value.
A note for the community
Problem
I have Juniper-structured syslog messages in the following format:
"message": "<28>1 2025-02-25T19:46:40.887Z mx204-lab R6_RR_MPLS_LAB:rpd 23152 RPD_BGP_NEIGHBOR_STATE_CHANGED [[email protected] peer-name=\"10.11.11.68 (Internal AS 65545)\" old-state=\"OpenConfirm\" new-state=\"Established\" event-type=\"RecvKeepAlive\" instance=\"master\"] BGP peer 10.11.11.68 (Internal AS 65555) changed state from OpenConfirm to Established (event RecvKeepAlive) (instance master)"
Vector correctly parses the log using parse_syslog. However, I want to rename the key "[email protected]" to "junos_event_tags" using the following transformation:
.junos_event_tags = del(."[email protected]") # Rename
This works as expected in the Vector Playground, but when applied inside Vector, the transformation does not take effect. As a result, OpenSearch still receives the original key name, such as "[email protected]".
This is the VRL code
.message = string!(.message) if (match(.message, r'.*[email protected]')) { . |= parse_syslog!(.message) .junos_event_tags = del(."[email protected]") # rename }
Below is the output from the Playground:
{ "appname": "R6_RR_MPLS_LAB:rpd", "facility": "daemon", "hostname": "mx204-lab", "[email protected]": { "event-type": "RecvKeepAlive", "instance": "master", "new-state": "Established", "old-state": "OpenConfirm", "peer-name": "10.11.11.68 (Internal AS 65545)" }, "message": "BGP peer 10.11.11.68 (Internal AS 65555) changed state from OpenConfirm to Established (event RecvKeepAlive) (instance master)", "msgid": "RPD_BGP_NEIGHBOR_STATE_CHANGED", "procid": 23152, "severity": "warning", "timestamp": "2025-02-25T19:46:40.887Z", "version": 1 }
Configuration
Version
vector 0.44.0 (x86_64-unknown-linux-gnu 3cdc7c3 2025-01-13 21:26:04.735691656)
Debug Output
Example Data
{
"message": "<28>1 2025-02-25T19:46:40.887Z mx204-lab R6_RR_MPLS_LAB:rpd 23152 RPD_BGP_NEIGHBOR_STATE_CHANGED [[email protected] peer-name="10.11.11.68 (Internal AS 65545)" old-state="OpenConfirm" new-state="Established" event-type="RecvKeepAlive" instance="master"] BGP peer 10.11.11.68 (Internal AS 65555) changed state from OpenConfirm to Established (event RecvKeepAlive) (instance master)"
}
Additional Context
No response
References
No response
The text was updated successfully, but these errors were encountered: