Skip to content
Advertisement

select a single field with applying filters in elasticsearch

I would like to select all the filename field values by ACCOUNT and APPLICATION_NAME Assuming as in SQL I need to do this :

this is a screenshot of a log entry sample in the kibana interface

enter image description here

Advertisement

Answer

selecting the unique values of a specific field is exactly like running an aggregation query at one of the SQL databases for example

  • selecting by field.keyword is something like passing an enum value that should exactly match one of the existing values against this field.

  • setting size to 0 will retrieve the aggregation result only without associating with it the list of sources.

  • in an agg query as I said above it is selecting one of the aggregation functions against some fields that could be one or more

  • incase they are multiple this should become a composite aggregation.

  • Composite aggregartion require specifing composite.sources in the query request body.

this query worked for me in case I wanted to selelct filename and POD_ID uniques pairs.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement