Splunk Search

Curl with dynamic url not working

palak_247
Observer

I am trying to make a curl request to a direct json link and fetch the result. When i hardcode the URL it works fine but my url is dynamic and gets created based on the search result of another query.

I can see my curl command is correct but it doesnt give proper output

Labels (1)
0 Karma

palak_247
Observer

I have a search query S1 which gives me a result  X with numeric values (203, 204, 205) and  I am able to populate this in a table. Now I want to bind this number with a url to create a dynamic url specific to that number.
For example URL is https://cnac.ca/data/json/npas.json  and from S1 query i get the result value as 203, I want to create URL : https://cnac.ca/data/json/npa203.json and want to hit this to get the response back to get the required data. 

For this I am using curl command, but when I try to create a dynamic URL and pass it in curl command it doesn't accept it.

Please suggest.

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Standard SPL doesn't have a curl command.  You should ask the developer who developed the app that gives you curl, or consult its manual to find out the correct syntax and any limitations it may have. (Given that "Apps and Add-ons" forum is gone from this board, Splunk Dev might be a successor.)

Also, you talk about "dynamic url" as if it is a Splunk feature.  It is not.  Maybe you can illustrate your SPL snippet so volunteers can understand precisely what you are referring to?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Please can you provide a more detailed example of the issue you are facing (anonymising sensitive information such as ip addresses etc.)

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...