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!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...