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!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...