Last active
December 10, 2024 10:29
-
-
Save leebenson/b404ec89c0d4dc6f532db868d8c77514 to your computer and use it in GitHub Desktop.
Example Vector config to parse an XML file
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
[sources.stdin] | |
type = "stdin" | |
[transforms.parse_xml] | |
type = "remap" | |
inputs = ["stdin"] | |
source = ''' | |
. = parse_xml!(.message) | |
.root.new_field = "example_value" | |
''' | |
[sinks.console] | |
type = "console" | |
inputs = ["parse_xml"] | |
encoding.codec = "json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run:
You should see in the console (among other things):