Can we limit number of unique values per fields?

The company i work for has had some query regarding this matter. They want to check if elasticsearch is capable of limiting the number of unique values allowed in a field.

EX: the fields "source_ip" may only have three unique values, say,, and

I searched through the elasitcsearch documentation whether the indices settings, or field mapping supports this, but i could find such possibility.

Is there any way this can be done ?

Welcome to our community! :smiley:

No there's not, you'd need to do it during ingestion. You could use an ingest node for it, assuming you don't even want the data -

Thanks mate, I have not looked into injection. I will check if this solves our need.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.