Knowledge Management

What is the max character limit for a macro?

hulahoop
Splunk Employee
Splunk Employee

I have a macro which does not work when invoked in a search, but does work when the contents are cut and paste directly into the search. I'm guessing this is due to a max character limit for macros. This macro is 27,000+ characters. 🙂

Tags (2)
0 Karma

hulahoop
Splunk Employee
Splunk Employee

no updates, but will be onsite with customer next week, will update then

0 Karma

chinmayc469
Explorer

Hi,

did you get solution for this issue, even i am facing same issue.

0 Karma

araitz
Splunk Employee
Splunk Employee

any update to this issue?

0 Karma

Genti
Splunk Employee
Splunk Employee

27,000+? holy macro!!

araitz
Splunk Employee
Splunk Employee

Hi hulahoop!

Do you see any errors thrown in splunkd.log?

My guess is that you are expanding past the default macro recursion depth as defined in limits.conf:

# max recursion depth for macros
# considered a search exception if macro expansion doesn't stop after this many levels
max_macro_depth = 100

If it fails silently, that's not good. Try appending "|format" to the end of the macro search and see if there are more than 100 levels of recursion in the resulting format string.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...