Hello,
I'm trying to remove [] from my data as it is not supported in Kibana.
Generally, I'm doing it very well with gsub (with http input).
Now I'm using rabbitmq input and gsub is not working. I can't figure out why, and I've tested different solutions (see below). Note that I've tried other mutate options like rename and it is working well. I also tried gsub to replace for example , with ; and it is not working.
input {
rabbitmq {
host => "x.x.x.x"
subscription_retry_interval_seconds => 5
exchange => "amq.topic"
key => "#"
auto_delete => "true"
user => "X"
password => "x"
metadata_enabled => "true"
codec => "json"
}
}
filter {
mutate {
#gsub => [ "metrics","\]",""]
#gsub => [ "metrics","\[",""]
gsub => [ "metrics","\\[|\\]",""]
}
}
output {
This is an example of the json i'm receiving
{
"_index": "proteus-rabbitmq-2017.09.12",
"_type": "logs",
"_id": "AV51Q5agOmTEVnBW6Jvj",
"_score": null,
"_source": {
"@timestamp": "2017-09-12T08:45:16.697Z",
"@version": "1",
"topic": "@metadata",
"timestamp": "2017-09-12T08:45:16.680Z",
"tags": [],
"metrics": [
{
"dataType": "float",
"name": "temperature",
"value": 14,
"timestamp": "2017-09-12T08:45:16.680Z"
},
{
"dataType": "float",
"name": "humidity",
"value": 56,
"timestamp": "2017-09-12T08:45:16.680Z"
}
]
},
"fields": {
"@timestamp": [
1505205916697
],
"metrics_test.timestamp": [
1505205916680,
1505205916680
],
"timestamp": [
1505205916680
]
},
"sort": [
1505205916697
]
}