Splunk Search

Dynamic field-names for lookups

Matthias_BY
Communicator

Hello,

i have a scripted lookup which is working fine. i configured in the lookups that the field name is called clientip for lookups.

now i want to make it more dynamic so that the lookup can also be used for other fields containing an ip address. those fields might be clientip, src_ip, source_ip, dst_ip, dest_ip and so on.

currently i found only that i need to configure one lookup command for each field name or rename the field in a pre command.

alt text alt text

i want to make my app ip reputation more generic. so that someone can type

... | lookup threatscore src_ip

as well as

... | lookup threatscore clientip

or other field names depending what's required.

Thanks a lot
Matthias

0 Karma
1 Solution

starcher
Influencer

You could do the one lookup then just add "AS" so " | lookup threatscore ip AS src_ip" That will map the src_ip to the ip field from your lookup as you do it.

View solution in original post

starcher
Influencer

You could do the one lookup then just add "AS" so " | lookup threatscore ip AS src_ip" That will map the src_ip to the ip field from your lookup as you do it.

Matthias_BY
Communicator

great this is working - so easy 😉 thanks a lot

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...