All Apps and Add-ons

Execute https get request from the Splunk SPL

damucka
Builder

Hello,

I need to execute a GET request from the Splunk search, passing the header and, this is important, be able to receive the header of the answer, not only the body (curl_message).

My issue is that with the first GET request a token needs to be requested and first with this token I can proceed to the next requests (POST). This token comes however over the header and I have no impact on this.

If possible I would like to stick to the SPL search, if needed I can install additional Apps, but I would like to avoid coding in Python / creating custom commands. 

I tried to achieve my goal using the Webtools App, please see the code below, however there seems to be only the curl_message to be returned, not the response header. Or at least I would not know how to force the Webtools App to return it.

Please advice.

Kind Regards,

Kamil

 

 

| makeresults count=1
| eval header="{\"x-csrf-token\":\"fetch\"}"
| curl user= pass= method=get headerfield= header debug=true  uri="https://myip/sap/opu/odata/sap/INBOUNDCONNECTOR/InboundAlertSet"

 

 

  

Labels (1)
Tags (1)
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...