Compare 2 tables and add matching field in second table to first table

How can I Compare 2 tables and add matching field in second table to first table. Not sure what query syntax should I use

Table 1

Field1
1020
1021
1022
1023
1025

Table2
Field1 FieldX
1021 "Good"
1023 "Bad"

Result
Table3
Field 1 FieldX
1020
1021 "Good"
1022
1023 "Bad"
1025

Are you taking data from a database here?

The data is stored in elastic search. I am just using the term "tables" to illustrate my problem as I am still not very familiar with elasticsearch terms.

Assuming I have loaded the two "Tables" into elasticsearch. How should I write the query to accomplish the previously mentioned scenario?

You probably mean an index then.

But no, you cannot do this within ES, you would need to do it in your application code.

I am looking at accomplishing this in the query as I am not sure if doing at the application code level will allow me to pass the result into Kibana.

Can I do this?

Nope.

:slightly_smiling: Thanks

Can I use logstash to input 2 index at one go and can try to match the contents of one index with the content of the other

Maybe with a ruby script, or the fingerprint filter.