Getting Data In

Can't I read file in this directory, or should I use alert action to output csv?

phamxuantung
Communicator

Hello,

I have a search query that have a |outputlookup report.csv at the end, and save that as an alert to run daily.

But when I want to check it using |inputlookup report.csv, it's found no result.

I check the job inspection of the alert and found the csv was ouputed at splunk/var/run/splunk/csv

Can't I read file in this directory, or should I use alert action to output csv?

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @phamxuantung,

at first, as @chaker hinted, check if the outputcsv search gives results.

Then I need an additional information: report.csv is a csv file or a lookup? in other words: did you created a lookup called reports.csv?

Inputlookup is a command that read lookups not csv files, so you should create a lookup, called reports.csv to use it.

Otherwise, to directly read a csv file, you shuld use the inputcsv command (https://docs.splunk.com/Documentation/Splunk/9.0.0/SearchReference/Inputcsv) instead of inputlookup.

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @phamxuantung,

at first, as @chaker hinted, check if the outputcsv search gives results.

Then I need an additional information: report.csv is a csv file or a lookup? in other words: did you created a lookup called reports.csv?

Inputlookup is a command that read lookups not csv files, so you should create a lookup, called reports.csv to use it.

Otherwise, to directly read a csv file, you shuld use the inputcsv command (https://docs.splunk.com/Documentation/Splunk/9.0.0/SearchReference/Inputcsv) instead of inputlookup.

Ciao.

Giuseppe

gcusello
SplunkTrust
SplunkTrust

Hi @phamxuantung,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated by all the contributors 😉

0 Karma

chaker
Contributor

The first thing to check is that your daily report produces results. Remove |outputlookup and run.

If append=false is set in the outputlookup, it will overwrite the prior results, which could be an empty set.

The alert action, and what you are doing with outputlookup are the same I believe.

 

 

0 Karma

phamxuantung
Communicator

My query certainly produce results, and the file in var/splunk/csv also have that result but I can't use inputlookup.

Curiously, when I ran |inputcsv I can read it alright.

Maybe because I use |outputcsv so I have to use |inputcsv to read it.

Similarly, maybe I should use |outputlookup to use |inputlookup

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...