Knowledge Management

Is there a way to flip the values of fields? Ex: sourceIP to destinationIP by simply using a command

jrodriguez233
Engager

Here is what I'm trying to do. Say I have 10 servers being targeted by several public IP addresses, is there anyway to flip the values where instead of having to copy all the 10 internal IP address as source and finding all the public IP addresses?

Example query:

index=myfirewall | table srcIP,destIP,action

Output scenario:
100 attacking IPs -> 10 servers

Desired outcomes:

1

100 src attacking IPs -> 10 destination servers | "flip?"

10 src servers IPs -> 100 destination IP addresses

2

Any internal source IP -> 100 destination attacking IP addresses (without having to copy the entire list)

Tags (1)

woodcock
Esteemed Legend

Like this:

index=firewall
| stats dc(srcIP) AS count values(srcIP) AS destIPs BY destIP
| where count>100

daniel333
Builder

Maybe soemthing like this?

| eval  temp_src = src_ip 
| eval  temp_dest = dest_ip 
| eval src_ip = temp_test
| eval dest_ip = temp_src
0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...