Splunk Search

How to pass key & value array into macro?

koshyk
Super Champion

Just checking if there is a smart way of passing "key" and "value" (ideally key-value array) into a macro

Ideally i'm looking for

## mykeyValueArray={key1:value1, key2:value2} 
[my_macro(1)]
args = mykeyValueArray
definition = index=abc sourcetype=xyz  $mykeyValueArray$

or atleast something like below as a baby-step

[my_macro(2)]
args = mykey,myvalue
definition = index=abc sourcetype=xyz  $mykey$=$myvalue$

we need to dynamically pass keys & values into the macro

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The latter method should work.

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

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

The latter method should work.

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...