Splunk Search

Different values in column between two rows

vb1612
New Member

Hi , I am having data like

               Col1                Col2(created from values())

row 1 X A B C
row 2 Y A B

how to get column with value C as its unique value in col2

Thanks

Tags (1)
0 Karma
1 Solution

nareshinsvu
Builder

Not very clear. Do you want seperate row for "C" ?

<your base search>| makemv delim=" " col2|mvexpand col2

View solution in original post

0 Karma

nareshinsvu
Builder

Not very clear. Do you want seperate row for "C" ?

<your base search>| makemv delim=" " col2|mvexpand col2
0 Karma

vb1612
New Member

as A B already there in one row in single column , so want difference between two rows which is C

0 Karma

nareshinsvu
Builder

Not sure if this helps. You can use the logic according to your requirements. Hope it helps

<your base search>| makemv delim=" " col2|mvexpand col2 | stats count(col2) as count by col2 | eval new_column=if((count=1),col2,"") | table new_column
0 Karma

vb1612
New Member

to clarify

col1 having X
Col2 having A B C (multivalues)

second row col2 A B

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...