Splunk Search

Can I add a new column to an existing CSV lookup file?

wtaylor149
Explorer

I have a CSV file I'm using to hold data for use in other searches. This file has 5 columns (AcctNo, user, src_ip, count, Client). There are over 4K rows. This file works just fine in my searches. I was asked to add another column to the file but can't seem to get the file to update with the new column / results.

I'd rather not have to remove the file and rebuild it. I just want to add the new column to the existing CSV file.

I've tried:

|inputlookup myfile.csv | append [subsearch_with_new_results] | outputlookup myfile.csv

Thanks in advance for the help.

0 Karma

woodcock
Esteemed Legend

You need to use appendcols or eval or something else to create new columns (fields); using append creates new rows. Other than that, your approach is fine. Also, you should be aware of the new dataset feature that you could use to manually edit your lookup:
http://docs.splunk.com/Documentation/Splunk/6.5.1/Knowledge/Aboutdatasets

0 Karma

somesoni2
SplunkTrust
SplunkTrust

The direction is correct, but may need tweaking based on how you're adding the additional column. You may have to use appendcols or any other command. Could you post your full query?

0 Karma
Get Updates on the Splunk Community!

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, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...