HI all
I have a scenario where i have to find the difference of two field value (string) for example
fileda="raj", "rahul", "rohan"
filedb="rahul", "rohan"
i need to have a third field as difference of the above two filed
fieldc="raj"
I am running out of ideas as how to do it. Can someone please help in this
Hi all...I got this fix by a simple logic of set diff command..thanks everyone
Please clarify the contents of these fields. Are they quoted strings separated by commas? Are they multi-value fields which each value being an unquoted string? Are they difference events with different values for the fields?
The best way to illustrate your data is to paste the raw event data into a code block (using the </> button) so that formatting from the event is preserved.
NO they are not quoted string seperated by comma..i think i dint put the example in the right way..let me try the below example
field_a field_b
rohan rohan
rahul rahul
raj
now i need to have the difference of the above to field
field_c
raj
Are these values always aligned, or are the values sometimes unaligned and you still want to know if they are in both fields?
Again, are these separate events or multi-value fields in the same event?
these are seperated events not a multivalue fields
Let me now if below query helps -
| makeresults count=3
| streamstats count as field1
| eval field2=field1+0
| eval field2=if(field2=3, Null(), field2)
| fields - _time
| eval field3=if(field1==field2, null(), field1)
| eval field_c=if(field_a == field_b, null(), field_a)
Hi all...I got this fix by a simple logic of set diff command..thanks everyone