Splunk Search

Updating a value in a lookup

joe06031990
Communicator

Hello,

I have a lookup called top sites with the bellow:

 

Name

Ip address

test1

10.10.10.10

test2

10.10.10.11

Test3

10.10.10.12

Test4

10.10.10.11

Test5

10.10.10.11

 

I am trying to update test3 IP address with the bellow:

 

| inputlookup topsites.csv | append [
|eval Name=Test3
|eval Ip address="9.9.9.9"] [|stats count by Name,Ip address]
| outputlookup
createinapp=true
topsites.csv

 

However it just adds another entry instead pf replacing the IP address value, what am I missing?

 

Thanks

Labels (4)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

From your original post, it looks like the field is called 'ip address' - if this is not the case, then use the real field name instead of 'ip address'

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this:

| inputlookup topsites.csv
| eval 'Ip address'=if(Name="Test3","9.9.9.9",'Ip address')
| outputlookup
createinapp=true
topsites.csv

joe06031990
Communicator

Good Morning,

 

Thanks for your reply,

 

when I run the search it adds another column with the updated value called 'Ip address' instead of updating the existing field value, is there a way around this?

 

Thanks

 

Joe

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

From your original post, it looks like the field is called 'ip address' - if this is not the case, then use the real field name instead of 'ip address'

Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...