My gsub doesn't recognize predefined patterns. What am I missing?

I'm trying to do a string replace on every MONTH in my message, but when I run it nothing gets replaced:

            if "foo" in [tags] {
                    mutate {
                            gsub => [
                                    "message",
                                    "%{MONTH}",
                                    "FOOBARBAZ"
                            ]
                    }
            }

I manually plugged in the regular expression for the MONTH pattern and it works fine:

            if "foo" in [tags] {
                    mutate {
                            gsub => [
                                    "message",
                                    "\b(?:Jan(?:uary|uar)?|Feb(?:ruary|ruar)?|M(?:a|ä)?r(?:ch|z)?|Apr(?:il)?|Ma(?:y|i)?|Jun(?:e|i)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|O(?:c|k)?t(?:ober)?|Nov(?:ember)?|De(?:c|z)(?:ember)?)\b",
                                    "FOOBARBAZ"
                            ]
                    }
            }

Clearly I'm missing something obvious. Problem is I don't know what!

gsub doesn't support grok patterns.

Well that's a huge letdown. My regular expression is like 80 lines when I pull in the patterns I need. Oh well.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.