Replies: 1 comment
-
Vector version info: Config: [sources.vector_metrics_source] [transforms.filter_metrics] [transforms.new_metrics] [transforms.enrich_metrics] [sinks.print] |
Beta Was this translation helpful? Give feedback.
-
Vector version info: Config: [sources.vector_metrics_source] [transforms.filter_metrics] [transforms.new_metrics] [transforms.enrich_metrics] [sinks.print] |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am new to vector and VRL. I have a metric thath I am trying to send to GCP cloud monitoring sink. We want to process the metric's value from a json and then set it in a new field. Here is a sample input:
{"name":"some_service.metric_name_sample","tags":{"key1":"val1","key2":"val2"},"kind":"absolute","gauge":{"value":1.0}}
I basically need to fetch the value from gauge and set it as one of the fields inside tags. Like expected output:
{"name":"some_service.metric_name_sample","tags":{"key1":"val1","key2":"val2", "value": 1},"kind":"absolute","gauge":{"value":1.0}}
Is it possible to do it using remap? I thought it would be as simple as:
On trying this:
It looks like gauge needs to be parsed somehow, I tried parse_json, but that also kind of didn't work. It looks like .gauge is getting null value somehow.
Error:
2023-07-25T11:40:46.827680Z ERROR transform{component_kind="transform" component_id=enrich_metrics component_type=remap component_name=enrich_metrics}: vector::internal_events::remap: Mapping failed with event. error="function call error for \"parse_json\" at (346:365): expected string, got null" error_type="conversion_failed" stage="processing" internal_log_rate_limit=true
Can somebody help me with this? @jszwedko
Beta Was this translation helpful? Give feedback.
All reactions