All Apps and Add-ons

When trying to run curl command on Windows, why do I receive "'rex' is not a recognizable command" error?

santoshdvn
New Member

Hi ,

I am trying to run curl command on windows command prompt . I am getting following error at 'rex' in the search query

curl -k -u admin:pass -d search=" search (host=xxxx-xxxx-xxxx) | rex field=_raw mode=sed \"s/abc/'/g\" "  -d "output_mode=csv" http://localhost:8089/servicesNS/admin/search/search/jobs/export

I am getting following at 'rex'

'rex' is not recognizable command 

Thanks,
Santosh

0 Karma

richgalloway
SplunkTrust
SplunkTrust

It sounds like Windows is processing the pipe character within the search query instead of passing it on as part of the curl command. Try escaping the pipe.

curl -k -u admin:pass -d search=" search (host=xxxx-xxxx-xxxx) ^| rex field=_raw mode=sed \"s/abc/'/g\" "  -d "output_mode=csv" http://localhost:8089/servicesNS/admin/search/search/jobs/export
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...