I would like to delete first two parts, but the second one is a kubernetes.namespace value so this is a dynamic value.
This is what i need:
prometheus.xyz-dev.label.name => label.name
prometheus.abc-prod.label.name => label.name
or eventually
prometheus.xyz-dev.label.name => prometheus.label.name
I need to create an ingest pipeline which can to that, but i have no idea how to do that. Can you help?
Ok, I partly resolve that problem, I created two pipelines, the first one checks metricset.module and runs another pipeline which changes fields name. But I have to define each field name (right now its more than 60), this is not a generic solution. Do you have any idea how can i do that?
Are the first two parts (prometheus.xyz-dev and prometheus.abc-prod) always the same?
I mean, are they static and equivalent to a limited set of values or can they change randomly?
Also, please paste here a sample of input documents and tell us if by any chance you're using logstash in your stack to ingest data or if you're ingesting them directly into elastic from another source.
First part so "prometheus" is static, but the next one not. This is the name of namespace from kubernetes, so we have a lot of namespaces and we will have a lot of new. And then there is a name of metric. As you can see in my second message, i did it (delete second part - namespace) but i had to write rename pipeline for each metricname. There are currently about 60 metric names, but there may be more in the future. So i would like to do sth dynamic
We skip the logstash, flow is from metricbeat to elasticsearch
It is not very nice to see but it should fit your case. I don't remember how (and if you can) to find the second occurrence of a string in painless without using the regex (to use them you have to enable them in the elasticsearch.yml with the consequent elasticsearch warning about it).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.