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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...