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!

Index This | What’s a riddle wrapped in an enigma?

September 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

BORE at .conf25

Boss Of Regular Expression (BORE) was an interactive session run again this year at .conf25 by the brilliant ...

OpenTelemetry for Legacy Apps? Yes, You Can!

This article is a follow-up to my previous article posted on the OpenTelemetry Blog, "Your Critical Legacy App ...