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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...