- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unable to pass header using curl command
I am trying to hit a URL from splunk using curl command. The end point needs an header to be passed with the key values as "X-User-ID". I am passing the value as below but I still get an error message stating that the value is not passed in the header. Can you help me understand if my query is incorrect.
| eval header="{\"X-User-ID\": \"myuserid\"}" | curl method=get headerfield=header uri="https://domainname/getstatusData?startTime=2021-07-07%2008:50:00&endTime=2021-07-07%2012:50:00&authe..." debug=true
curl message: "message":"Missing request header \u0027X-User-ID\u0027 for method parameter of type String"
I am able to invoke this from POSTMAN without any issues.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


I hope you are using this app.
Can you please try this?
| curl headers="{'X-User-ID':'myuserid'}" url="https://domainname/getstatusData?startTime=2021-07-07%2008:50:00&endTime=2021-07-07%2012:50:00&authe..."
For more: https://github.com/bmacher/splunk-curl-command
Thanks
KV
▄︻̷̿┻̿═━一
If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.
