Splunk Search

Compare columns in same table

carlospalma03
Engager

Hello, I have the following table:

column1 column2

Andrew Andrew
George George
Paris Berlin

I would like to get as output the following:

column 1 column2

Paris Berlin

Tables come from the use of the | table command

| table column1,column2

Is there any way this can be done?

I tried | table column1, column2 | where NOT match(column1,column2) but no results are found

0 Karma

oda
Communicator

Try the following command.

| table column1, column2 |where column1!= column2

carlospalma03
Engager

Turns out that one of my column names came from a json. Something like this:
|spath "object.property"| ....|table "object.property",column2

and oda's solution was not working at first until I did

|spath "object.property" output column1 | table column1,column2

My bad for not providing more info. Looks like to compare both things have to be strings and for some reason you cannot just use the path in the json

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...