Hi community,
I'm trying delete some unused fields from index, through the ingest pipeline.
Current config :
"remove": {
"if": "ctx._index.contains('stg-index-short-')",
"field": "message"
}
}
Expected behavior :
_index: stg-index-short-*
should return nothing
Current behavior :
Still having message field on the index stg-index-short-*
There is any another way to delete this field from target ?
Thank you for your help
leandrojmp
(Leandro Pereira)
February 26, 2024, 12:04pm
2
I don't think you can use the _index
field to filter since it may only exists after all the processing is done.
You will need to use another filter to field.
thank you for the reply ..
I tried to filter with another field, but didn't help
{
"remove": {
"if": "lg.meta.component == indexshort",
"field": "message"
}
}
I got this error
Could not Put pipeline stg-pipeline : [{'type': 'script_exception', 'reason': 'compile error', 'processor_type': 'remove', 'script_stack':
leandrojmp
(Leandro Pereira)
February 26, 2024, 2:52pm
4
Please share the entire error.
Also, If I'm not wrong the conditional is wrong.
It needs to be something like this: ctx.lg?.meta?.componet == 'indexshort'"
1 Like
Thank you that works fine
system
(system)
Closed
March 27, 2024, 12:20pm
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.