Splunk Search

CSV Lookup File From Share

paddy3883
Path Finder

Is it possible to set Splunk to read a lookup from a CSV file on a different machine? We have a shared directory internally and ideally we'd let to have our CSV files for the lookups on the share to allow modification without need for uploading or logging directly onto the Splunk server

Tags (2)
0 Karma
1 Solution

nicholasgrabows
Path Finder

There is a new splunkbase app called "importutil". It lets you import csv files (or any input) from an http url via the splunk search command line. Also works for ftp. sftp is experimental. Search for importutil on Splunkbase

Here is an example that imports data from the federal reserve economic data website:

|importutil http http://research.stlouisfed.org/fred2/data/PAYEMS.csv
| multikv
| table DATE, VALUE

Here is an example that imports data from the Bureau Of Labor Statistics... it uses ftp:

|importutil ftp ftp://ftp.bls.gov/pub/time.series/ce/ce.data.102.WeeklyEarningsHist
| multikv
| table series_id, year, period, value, footnote_codes

View solution in original post

nicholasgrabows
Path Finder

There is a new splunkbase app called "importutil". It lets you import csv files (or any input) from an http url via the splunk search command line. Also works for ftp. sftp is experimental. Search for importutil on Splunkbase

Here is an example that imports data from the federal reserve economic data website:

|importutil http http://research.stlouisfed.org/fred2/data/PAYEMS.csv
| multikv
| table DATE, VALUE

Here is an example that imports data from the Bureau Of Labor Statistics... it uses ftp:

|importutil ftp ftp://ftp.bls.gov/pub/time.series/ce/ce.data.102.WeeklyEarningsHist
| multikv
| table series_id, year, period, value, footnote_codes

nicholasgrabows
Path Finder

paddy, good luck. If this ends up working for you and if you have a moment please rate the app on splunkbase. Thanks. Good Luck!

0 Karma

paddy3883
Path Finder

Many thanks, this looks perfect.

0 Karma

lguinn2
Legend

I think the following will work, but I'm not able to test it.

To make the English easier, assume that the user account running Splunk (splunkd and splunk web) is named splunkAcct.

First, make sure that splunkAcct can open and read files in the shared directory.

Second, put a link in the proper Splunk directory (lookups) that points to the correct file in the shared directory.
On Linux, use a hard link. On Windows, it's a short cut. Do this as splunkAcct so that the permissions/ownership are appropriate.

If that doesn't work you could write a script that runs on the Splunk server and copies over the files every hour.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...