All Apps and Add-ons

How to apply curl to each search result without map command ?

ssanplunk
Path Finder

Hi,
I am using curl command in Web Tools Add-on.

How to use "curl" query to make result of below without map command ?

index=test
=> result field is "NUM"
1
2
3

|curl http://1.1.1.1/q?q=1
|curl http://1.1.1.1/q?q=2
|curl http://1.1.1.1/q?q=3

I used macro as below for this case, but it didn't apply.

macro(1): curl http://1.1.1.1/q?q=$NUM$
query: index=test | `macro(NUM)`

result is below:

|curl http://1.1.1.1/q?q=NUM
|curl http://1.1.1.1/q?q=NUM
|curl http://1.1.1.1/q?q=NUM
1 Solution

jkat54
SplunkTrust
SplunkTrust

Please upgrade to the latest version of the app: 1.2.3

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

Then this search should work:

...
| eval data="q=".NUM
| curl uri="http://1.1.1.1/q" datafield=data debug=true

View solution in original post

jkat54
SplunkTrust
SplunkTrust

Please upgrade to the latest version of the app: 1.2.3

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

Then this search should work:

...
| eval data="q=".NUM
| curl uri="http://1.1.1.1/q" datafield=data debug=true

ssanplunk
Path Finder

Hi

Thank you for your help!
I will update app and try the SPL.

0 Karma

ssanplunk
Path Finder

Hi jkat54,

I completed test at web tools ver1.2.3.
It works good!

Thanks!

0 Karma

chrisyounger
SplunkTrust
SplunkTrust

Give this a try and let me know if it solves your problem:

|curl http://1.1.1.1/q?q=1
|append [|curl http://1.1.1.1/q?q=2]
|append [|curl http://1.1.1.1/q?q=3]
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...