Getting Data In

Making HTTP get requests with splunk

nikhilnsr1998
Explorer

How can i create a scheduled report that runs every hour and makes GET requests to fetch data from an open source.

 

basically querying the same page and updating latest data available on premises.

Labels (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

There probably are several apps on splunkbase that can help with that.

---
If this reply helps you, Karma would be appreciated.
0 Karma

nikhilnsr1998
Explorer

could you please share a few?

 thanks

 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Try the webtools app - not supported in Splunk Cloud

https://splunkbase.splunk.com/app/4146/

 

nikhilnsr1998
Explorer

thanks for the help. This seems to be correct, can you please help out on one other problem

within the webtools application i ran below query to fetch data from rapidapi :

 

| curl method=GET user=<splunk_username>pass=<splunk_password> headerfield= {
'x-rapidapi-host': "community-open-weather-map.p.rapidapi.com",
'x-rapidapi-key': "<apikey-from-rapidapi>"
}
data={"q":"London,uk","lat":"0","lon":"0","callback":"test","id":"2172797","lang":"null","units":"imperial","mode":"json"} uri="https://community-open-weather-map.p.rapidapi.com/weather"

 

I am getting below results (pfa screenshot)

 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

See the example of using custom headers here

https://splunkbase.splunk.com/app/4146/#/details

headerfield option takes a field name, not a string - in any case, you need to quote the entire JSON payload and escape the doublequoted JSON fieldnames and values.

add the debug=t option to the curl query and you will get some feedback

 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...