Hello friends. I am trying to reindex some data to another index but with a little differences.
In the first index I have this kind of hit:
{
"ENVA": {
"Login": {
"status": "passed"
}
},
"ENVB": {
"Login": {
"status": "passed"
}
},
"ENVC": {
"Login": {
"status": "passed"
}
},
"ENVD": {
"Login": {
"status": "failed"
}
}
}
So I want to split each Env in other doc each one some like this:
This is a hit with ENVA info:
{
"ENV": {
"Login": {
"status": "passed"
}
}
}
This is a another with ENVB info:
{
"ENV": {
"Login": {
"status": "passed"
}
}
}
So I was doing this with logstash but I failed because I get this error:
Only String and Array types are splittable. field:Login is of type = NilClass
This is my logstash configuration I do not know how I can split this doc in multiple docs:
input {
elasticsearch {
hosts => "localhost:9200"
index => "logs-testing"
size => 500
scroll => "5m"
docinfo => true
}
}
filter {
split {
field => "Login"
}
}
output {
elasticsearch {
hosts => "localhost:9200"
index => "logs-version2Testing"
document_id => "%{[@metadata][_id]}"
}
}
Please help I tried with multiple ways but I can not got it