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
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...