- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to find data which does not exist in index1 when compare to index2?
I want to compare two index index1 and index2 and print values where index1 values does not exists in index2
fro ex:
Index1. index2
field1. field2
1 1
2 3
3 4
output
2
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Do you mean
index IN (index1, index2)
| eval field = coalesce(field1, field2) ``` common field name ```
| stats values(index) as indices by field ``` which index contains this value? ```
| where mvcount(indices) == 1 AND indices == index1 ``` only appears in index1 ```
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
when compared field1 with field2, I need data of field1 which does not exist in field2.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Can you explain "data of field1"? If you mean the value of field1, it is already coalesced into field. If you prefer to have the name field1, you can just renamed it field1 after the where filter.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes its value of the field how to print the values only exist in index1 just do table indices? its not giving any output
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Ah I omitted quotation marks in filter.
index IN (index1, index2)
| eval field = coalesce(field1, field2) ``` common field name ```
| stats values(index) as indices by field ``` which index contains this value? ```
| where mvcount(indices) == 1 AND indices == "index1" ``` only appears in index1 ```
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I wrote this query but not working as expected
index=index1 OR index=index2 | eval index=if(index=="index1",1,2) | stats values(field1) as field1 by field2, index | join type=left field1 [search index=index1 OR index=index2 | stats values(field2) as field2 by field1, index] | eval missing=if(isnull(field2), field1, "") | search missing!="" | table field1 field2 index missing
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi
maybe this inner/outer join post helps you?
r. Ismo
