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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...