Splunk Search

Webtools app how to make get requests

nikhilnsr1998
Explorer

Hello @jkat54 , @richgalloway   

I am new to the add-on and am not able to figure out how to make API calls with this.

Attempting to use the  OpenWeatherMap api below { OpenWeatherMap API - Free Weather Data (for Developers) (rapidapi.com) }

 

 

 

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

 

 

instead of getting the data i am getting below output. {attached screenshot}

can you please tell me what am i doing wrong

Tags (3)
0 Karma

efavreau
Motivator

@nikhilnsr1998I only have some little info for you. The username and password shouldn't be what you use to log into Splunk. At least it isn't in my environment. I don't supply anything there. When I access that URL you provided in a web browser, I am told I didn't supply an API key. If the API key you have is specific to you, then consider not doing that, because your searches will show up in the audit log. Lastly, I also put the URI in double quotes. YMMV

###

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

nikhilnsr1998
Explorer

the issue was with  Openweathermap not providing the data for the requests.

Turns out they have a splunk app  :  TA-openweathermap

 

another issue i have is using passwords in my queries;

can i have some kind of password vault in splunk where i can securely save the passwords and reference in queries

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

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...