<?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: How to do regex based on commas in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453179#M128264</link>
    <description>&lt;P&gt;It seems like a perfect csv format, except the missing header...&lt;/P&gt;</description>
    <pubDate>Fri, 26 Oct 2018 00:20:40 GMT</pubDate>
    <dc:creator>ddrillic</dc:creator>
    <dc:date>2018-10-26T00:20:40Z</dc:date>
    <item>
      <title>How to do regex based on commas</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453176#M128261</link>
      <description>&lt;P&gt;I have data like this:&lt;/P&gt;

&lt;P&gt;21,enrollmentgroup,19936,40:G6:7Q:G6:89:FG,,nitro - Circle.one10,Phone,11.1.11313,C,10/25/18 4:58,Enroll,&lt;A href="mailto:enroll@ms.com"&gt;enroll@ms.com&lt;/A&gt;,Movies &amp;amp; TV,microsoft,Public,YES,,2019.11111.10112.0,0,0,0,Installed,App installed by user,10/24/18 14:50,10/25/18 4:00&lt;/P&gt;

&lt;P&gt;21,enrollmentgroup,19935,20:11:32:11:61:71,,nitro - Circle.one10,Phone,10.0.14393,C,10/25/18 4:58,Enroll,&lt;A href="mailto:enroll@ms.com"&gt;enroll@ms.com&lt;/A&gt;,PC Manager,c10f24324242432-43242,Internal,YES,11.5.1.11119,18.10.3.1009,0,0,0,Pending Install,Installed,10/24/18 14:49,10/24/18 22:09&lt;/P&gt;

&lt;P&gt;443,S-0001,11222,01:11:7F:E1:D1:71,,nitro - loop.one12,Phone,10.0.14393,C,9/3/18 12:23,Enroll,&lt;A href="mailto:enroll@ms.com"&gt;enroll@ms.com&lt;/A&gt;, Mapping Better,631d-2e321-4312-b511f-83f2,Internal,YES,10.0.0.623,20.0.0.5921,0,0,0,Pending Install,Unkown,8/31/18 9:33,10/2/18 0:20&lt;/P&gt;

&lt;P&gt;I wrote this but it appears to be too much for Splunk&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "(?&amp;lt;ig1&amp;gt;.+?)([,])(?&amp;lt;loc&amp;gt;.+?)([,])(?&amp;lt;ig2&amp;gt;.+?)([,])(?&amp;lt;MacAddress&amp;gt;.+?)([,])(?&amp;lt;modelType&amp;gt;.+?)([,])(?&amp;lt;ig3&amp;gt;.+?)([,])(?&amp;lt;OS&amp;gt;.+?)([,])(?&amp;lt;ig4&amp;gt;.+?)([,])(?&amp;lt;lastSeen&amp;gt;.+?)([,])(?&amp;lt;user&amp;gt;.+?)([,])(?&amp;lt;useremail&amp;gt;.+?)([,])(?&amp;lt;Application&amp;gt;.+?)([,])(?&amp;lt;ig5&amp;gt;.+?)([,])(?&amp;lt;deployed&amp;gt;.+?)([,])(?&amp;lt;public&amp;gt;.+?)([,])(?&amp;lt;assignedVersion&amp;gt;.+?)([,])(?&amp;lt;installedVersion&amp;gt;.+?)([,])(?&amp;lt;ig6&amp;gt;.+?)([,])(?&amp;lt;ig7&amp;gt;.+?)([,])(?&amp;lt;ig8&amp;gt;.+?)([,])(?&amp;lt;status&amp;gt;.+?)([,])(?&amp;lt;installedby&amp;gt;.+?)([,])(?&amp;lt;appFirstSeen&amp;gt;.+?)([,])(?&amp;lt;appUpdatedTime&amp;gt;.+?)([,]|$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any suggestions? I cannot edit profs etc. I must do this via regex within the query.&lt;BR /&gt;
Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 21:10:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453176#M128261</guid>
      <dc:creator>JoshuaJohn</dc:creator>
      <dc:date>2018-10-25T21:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to do regex based on commas</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453177#M128262</link>
      <description>&lt;P&gt;Made some changes to try and lower the greediness of my search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(.+?),(?&amp;lt;loc&amp;gt;.+?),(.+?),(?&amp;lt;MacAddress&amp;gt;.+?),,(?&amp;lt;ModelType&amp;gt;.+?),(.+?),(?&amp;lt;OS&amp;gt;.+?),(.+?),(?&amp;lt;LastSeen&amp;gt;.+?),(?&amp;lt;user&amp;gt;.+?),(?&amp;lt;useremail&amp;gt;.+?),(?&amp;lt;Application&amp;gt;.+?),(.+?),(?&amp;lt;deployed&amp;gt;.+?),(?&amp;lt;public&amp;gt;.+?),(?&amp;lt;assignedVersion&amp;gt;.+?),(?&amp;lt;installedVersion&amp;gt;.+?),(.+?),(.+?),(.+?),(?&amp;lt;status&amp;gt;.+?),(?&amp;lt;installedby&amp;gt;.+?),(?&amp;lt;appFirstSeen&amp;gt;.+?),(?&amp;lt;appUpdatedTime&amp;gt;.+?)$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Still getting the error: has exceeded configured match_limit&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 23:30:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453177#M128262</guid>
      <dc:creator>JoshuaJohn</dc:creator>
      <dc:date>2018-10-25T23:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to do regex based on commas</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453178#M128263</link>
      <description>&lt;P&gt;I think this improved it slightly again, still getting the error though.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;,(?&amp;lt;loc&amp;gt;.+?),.+?,(?&amp;lt;MacAddress&amp;gt;.+?),,(?&amp;lt;ModelType&amp;gt;.+?),.+?,(?&amp;lt;OS&amp;gt;.+?),.+?,(?&amp;lt;LastSeen&amp;gt;.+?),(?&amp;lt;user&amp;gt;.+?),(?&amp;lt;useremail&amp;gt;.+?),(?&amp;lt;Application&amp;gt;.+?),.+?,(?&amp;lt;deployed&amp;gt;.+?),(?&amp;lt;public&amp;gt;.+?),(?&amp;lt;assignedVersion&amp;gt;.+?),(?&amp;lt;installedVersion&amp;gt;.+?),.+?,.+?,.+?,(?&amp;lt;status&amp;gt;.+?),(?&amp;lt;installedby&amp;gt;.+?),(?&amp;lt;appFirstSeen&amp;gt;.+?),(?&amp;lt;appUpdatedTime&amp;gt;.+?)$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Oct 2018 23:57:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453178#M128263</guid>
      <dc:creator>JoshuaJohn</dc:creator>
      <dc:date>2018-10-25T23:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to do regex based on commas</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453179#M128264</link>
      <description>&lt;P&gt;It seems like a perfect csv format, except the missing header...&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 00:20:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453179#M128264</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-10-26T00:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to do regex based on commas</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453180#M128265</link>
      <description>&lt;P&gt;Try this: | rex field=_raw "^(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?,(?[^,]+)?"&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 02:07:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453180#M128265</guid>
      <dc:creator>jimmoriarty</dc:creator>
      <dc:date>2018-10-26T02:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to do regex based on commas</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453181#M128266</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "^(?&amp;lt;f1&amp;gt;[^,]+)?,(?&amp;lt;loc&amp;gt;[^,]+)?,(?&amp;lt;f3&amp;gt;[^,]+)?,(?&amp;lt;MacAddress&amp;gt;[^,]+)?,(?&amp;lt;modelType&amp;gt;[^,]+)?,(?&amp;lt;OS&amp;gt;[^,]+)?,(?&amp;lt;f7&amp;gt;[^,]+)?,(?&amp;lt;f8&amp;gt;[^,]+)?,(?&amp;lt;f9&amp;gt;[^,]+)?,(?&amp;lt;lastSeen&amp;gt;[^,]+)?,(?&amp;lt;user&amp;gt;[^,]+)?,(?&amp;lt;useremail&amp;gt;[^,]+)?,(?&amp;lt;Application&amp;gt;[^,]+)?,(?&amp;lt;f14&amp;gt;[^,]+)?,(?&amp;lt;deployed&amp;gt;[^,]+)?,(?&amp;lt;public&amp;gt;[^,]+)?,(?&amp;lt;assignedVersion&amp;gt;[^,]+)?,(?&amp;lt;installedVersion&amp;gt;[^,]+)?,(?&amp;lt;f19&amp;gt;[^,]+)?,(?&amp;lt;f20&amp;gt;[^,]+)?,(?&amp;lt;f21&amp;gt;[^,]+)?,(?&amp;lt;status&amp;gt;[^,]+)?,(?&amp;lt;installedby&amp;gt;[^,]+)?,(?&amp;lt;appFirstSeen&amp;gt;[^,]+)?,(?&amp;lt;appUpdatedTime&amp;gt;[^,]+)?"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This time with everything included...&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 02:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453181#M128266</guid>
      <dc:creator>jimmoriarty</dc:creator>
      <dc:date>2018-10-26T02:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to do regex based on commas</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453182#M128267</link>
      <description>&lt;P&gt;All those &lt;CODE&gt;.+?&lt;/CODE&gt; are very unnecessarily complex. It matches everything and the regex processor constantly needs to check if perhaps it should stop capturing and continue reading the comma and proceed with the next capturing group.&lt;/P&gt;

&lt;P&gt;As @jimmoriarty has already mentioned in his answer: replace the &lt;CODE&gt;.+?&lt;/CODE&gt; by &lt;CODE&gt;[^,]+&lt;/CODE&gt; (so matching all characters except comma), which makes it much, much more efficient.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 06:50:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453182#M128267</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-10-26T06:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to do regex based on commas</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453183#M128268</link>
      <description>&lt;P&gt;Awesome thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 14:34:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-regex-based-on-commas/m-p/453183#M128268</guid>
      <dc:creator>JoshuaJohn</dc:creator>
      <dc:date>2018-10-26T14:34:35Z</dc:date>
    </item>
  </channel>
</rss>

