Thank you for the reply.
I have already tried these examples but didn't work i don't know where is the problem.
i tried this
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
- add_fields:
target: pathtest
fields:
name: '%{[log][file][path]}'
logstash.conf
mutate{
add_field => { "[pathtest]" => "%{[pathtest]}"}
}
it gives me
"pathtest" => "%{[pathtest]}"
and i also tried this:
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
- add_fields:
target: '@metadata'
fields:
op_type: "%{[log][file][path]}"
logstash.conf
mutate{
add_field => { "[path]" => "%{[@metadata]}"}
}
It gives me
"path" => "{\"kafka\":{\"topic\":\"kafka-topic-test\",\"consumer_group\":\"logstash\",\"partition\":0,\"offset\":72,\"key\":\"null\",\"timestamp\":1720134475223}}"
there is no op_type in metadata... i don't know if i did something wrong ?
Any help would be sincerely appreciate!
Thanks!