<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Regex Character Limitation in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537417#M151924</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We tried to shorten the regex from 14,000 to 11,000 characters.&lt;/P&gt;&lt;P&gt;Is there any limits configuration we can tweak to override this Regex limitation&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2021 13:33:59 GMT</pubDate>
    <dc:creator>jadengoho</dc:creator>
    <dc:date>2021-01-27T13:33:59Z</dc:date>
    <item>
      <title>Why is there a Regex Character Limitation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537375#M151915</link>
      <description>&lt;P&gt;I have a very long regex query (12,000) character long- it consist o different hostname and IP Address combinations.&lt;/P&gt;
&lt;P&gt;Now when i run the regex it shows ::&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Regex: regular expression is too large.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12693i2CF5CA5A69EEEC0F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="error.png" alt="error.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As per checking the Regex can only accommodate -&lt;STRONG&gt;&amp;nbsp;8190 character&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;In the image you can see i use "&lt;STRONG&gt;a&lt;/STRONG&gt;" letter 8190 time. but if i add another letter it will show the error.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="search.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12692i702CA760E9898092/image-size/medium?v=v2&amp;amp;px=400" role="button" title="search.png" alt="search.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; Can somebody explain to me why is this happening and how can i execute my regex properly.&lt;/P&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 16:17:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537375#M151915</guid>
      <dc:creator>jadengoho</dc:creator>
      <dc:date>2022-02-23T16:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Character Limitation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537414#M151923</link>
      <description>&lt;P&gt;For reasons known only to those who wrote the code, Splunk can't handle a regular expression longer than 8190 characters.&amp;nbsp; The workaround is to make the regex short enough to fit into 8190 characters.&amp;nbsp; Sometimes a single &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command can be split into multiple smaller &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; commands.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 13:24:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537414#M151923</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-01-27T13:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Character Limitation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537417#M151924</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We tried to shorten the regex from 14,000 to 11,000 characters.&lt;/P&gt;&lt;P&gt;Is there any limits configuration we can tweak to override this Regex limitation&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 13:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537417#M151924</guid>
      <dc:creator>jadengoho</dc:creator>
      <dc:date>2021-01-27T13:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Character Limitation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537418#M151925</link>
      <description>Usually that kind of tweaks can do with parameters in limits.conf, but at least I cannot found any suitable for that.&lt;BR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/120445"&gt;@cpetterborg&lt;/a&gt; have you any idea for this?&lt;BR /&gt;&lt;BR /&gt;In curiosity how you can manage that regex? Usually much much shorter are already hard to update etc.</description>
      <pubDate>Wed, 27 Jan 2021 13:42:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537418#M151925</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2021-01-27T13:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Character Limitation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537420#M151927</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a 20,000+ combination of word/phrase that should be present on the logs to be routed to proper index.&lt;/P&gt;&lt;P&gt;Example"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CAT should have DOG - routed to sample1 index
RAT should have COUNT - routed to sample1 index.

In the transforms.conf 
REGEX = (cat.*dog|rat.*count|computer.*calculator|computer.*device.*v2)

https://goolge/sites/cat/page/dog
https://goolge/sites/rat/page/count
https://goolge/sites/computer/page/calculator
https://goolge/sites/computer/page/device/machine/v2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've done all the possibilities to compress the regex but that is the best i can do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 13:57:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537420#M151927</guid>
      <dc:creator>jadengoho</dc:creator>
      <dc:date>2021-01-27T13:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Character Limitation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537440#M151934</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/120445"&gt;@cpetterborg&lt;/a&gt;&amp;nbsp;found this which could help you&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Archive/Is-there-a-limit-on-searchable-characters-in-an-event/m-p/355545#M56407" target="_blank"&gt;https://community.splunk.com/t5/Archive/Is-there-a-limit-on-searchable-characters-in-an-event/m-p/355545#M56407&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 15:42:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/537440#M151934</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2021-01-27T15:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Character Limitation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/586151#M204182</link>
      <description>&lt;P&gt;In case this was never resolved, or for others who are interested, the solution here is to use multiple transforms stanzas to bring the total size under 8190, like so:&lt;/P&gt;&lt;P&gt;props.conf:&lt;/P&gt;&lt;PRE&gt;[my_sourcetype]&lt;BR /&gt;TRANSFORMS-index_routing = ruleset1, ruleset2&lt;/PRE&gt;&lt;P&gt;transforms.conf:&lt;/P&gt;&lt;PRE&gt;[ruleset1]&lt;BR /&gt;REGEX = (cat.*dog|rat.*count)&lt;BR /&gt;&lt;SPAN&gt;FORMAT = sample1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DEST_KEY = _MetaData:Index&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;[ruleset2]&lt;BR /&gt;REGEX = (computer.*calculator|computer.*device.*v2)&lt;BR /&gt;&lt;SPAN&gt;FORMAT = sample1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DEST_KEY = _MetaData:Index&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I would also argue in this specific case a different approach should be used as a regex this sizable will cause high CPU overhead during ingestion, especially if the source is high-volume.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 07:31:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-there-a-Regex-Character-Limitation/m-p/586151#M204182</guid>
      <dc:creator>mtulett_splunk</dc:creator>
      <dc:date>2022-02-23T07:31:33Z</dc:date>
    </item>
  </channel>
</rss>

