- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
quahfamili
Path Finder
12-26-2017
01:00 AM
Hi,
I was trying to use window batch file to run CLI search command.
The command is something like this:
splunk search "index=xx |eval xx| table xx xx xx" -output csv c:\test.csv
This cmd like works when I manually key in on cmd prompt, but when I saved the file as a batch files or *.cmd, the command will only run : splunk search "index=xx
I know the pipe in cmd needs to be escaped using caret (^|). However, it is not working even when I added the caret.
Thanks in advance.
AQ
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

somesoni2
Revered Legend
12-27-2017
08:20 AM
Give this a try
start "" CALL 'splunk.exe search "index=xx |eval xx| table xx xx xx" -output csv c:\test.csv'
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

somesoni2
Revered Legend
12-27-2017
08:20 AM
Give this a try
start "" CALL 'splunk.exe search "index=xx |eval xx| table xx xx xx" -output csv c:\test.csv'
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
quahfamili
Path Finder
12-26-2017
11:15 PM
Anyone have any ideas?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

nickhills
Ultra Champion
12-27-2017
01:43 AM
Do you have anything in your batch file to login as a Splunk user before running this command?
If my comment helps, please give it a thumbs up!
