Getting Data In

How do you replace ip address with name?

papalmi
New Member

We're looking to substitute the host field, which is an IP address, with the device name that corresponds to the IP address. I'm trying to do this using a .csv file and have the output automatically changed. I've resolved all the errors but I haven't been successful yet. Help would be appreciated. Thanks

Tags (4)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

If you have a .csv like this

ip,device
1.2.3.4,foo

then you can define that as a lookup table, and specify an automatic lookup for your sourcetype using ip as the input field and device as the output field - with potentially some renaming if the field isn't called ip in your data. Then Splunk will automagically add a device field to your events.

0 Karma

papalmi
New Member

note that |inputlookup .csv does output the contents of the .csv file correctly

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Did you check the box to overwrite field values?

Note, you may not be able to output to the same field name as your input.

0 Karma

papalmi
New Member

Yes, overwrite is checked. I'll try different field names and see what happens.

Thanks

0 Karma

papalmi
New Member

Hi Martin, thanks for the quick replay. Perhaps it's the input/output fields where the issue lies. The .csv file has 2 columns, clientip and clienthost. I'm trying to get the contents of clienthost (which is the device name) to replace the search output field host (which is the ip address). This is what's configured under Lookups> Automatic lookups>

Lookup input fields
clientip = host

Lookup output fields
clienthost = host

Thanks

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...