Hi Team,
Hope you doing well!
I am facing problem in creating dynamic field for an array in logstash.
The list of array is below:
[{"usage_start_time": "2022-08-07T22:00:00Z",
"usage_end_time": "2022-08-07T23:00:00Z",
"labels": [{
{
"key": "env",
"value": "Prod"
}, {
"key": "nodeID",
"value": "abcd"
}]
}]
I need to create [Labels][key] as a new field and [Labels][value] as the field-value. Now, this array length can be different for different event, also the key is not fixed.
Expected output for this message:
[{
"usage_start_time": "2022-08-07T22:00:00Z",
"usage_end_time": "2022-08-07T23:00:00Z",
"env": "prod",
"nodeID":"abcd"
}]
Please help me here, Let me know if any details I need to provide.