What is the field
attribute for log_to_metric
transform ?
#12120
-
From example. I am not sure I understand what it does [transforms.my_transform_id]
type = "log_to_metric"
inputs = [ "my-source-or-transform-id" ]
[[transforms.my_transform_id.metrics]]
type = "counter"
field = "status" # I don't understand how it maps to the output
name = "response_total"
namespace = "service"
[transforms.my_transform_id.metrics.tags]
status = "{{status}}"
host = "{{host}}" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @midnightexigent ! The |
Beta Was this translation helpful? Give feedback.
Hi @midnightexigent !
The
field
is the field of the event you want to operate on to generate the metric. In your example there, it is just incrementing the counter by 1, so it doesn't really matter which field you use (message
is a good default). If you were generating a different metric type, likeset
, though, the value of the field would be used. See this example, https://vector.dev/docs/reference/configuration/transforms/log_to_metric/#examples-set, where the value of the field is added to theset
metric that is generated.