<?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: Need to understand Regular Expression in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469928#M132250</link>
    <description>&lt;P&gt;Hi abilann,&lt;/P&gt;

&lt;P&gt;The regex is looking for a case insensitive match for &lt;CODE&gt;CPU_COUNT&lt;/CODE&gt; followed by one or more whitespace and puts the following characters that are not a new line in a field called &lt;CODE&gt;cpu_cores&lt;/CODE&gt;(in a greedy mode). &lt;/P&gt;

&lt;P&gt;This is a literal translation of the regex.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Wed, 08 Apr 2020 08:42:33 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2020-04-08T08:42:33Z</dc:date>
    <item>
      <title>Need to understand Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469922#M132244</link>
      <description>&lt;P&gt;Team,&lt;/P&gt;

&lt;P&gt;Can anyone please help me to understand the below regular expression used in field extraction?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)CPU_COUNT\s+(?P[^ \n]*)?
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Abilan&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 05:49:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469922#M132244</guid>
      <dc:creator>abilann</dc:creator>
      <dc:date>2020-04-08T05:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469923#M132245</link>
      <description>&lt;P&gt;Hi @abilann,&lt;BR /&gt;
your regex isn't readable, please use Code Sample button (the one with 101010) to display your regex.&lt;/P&gt;

&lt;P&gt;In addition, I suggest to put your regex and a sample of your logs in regex101.com site, you can test your regex and there's (on the right side) a description of the regex.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 06:52:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469923#M132245</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-04-08T06:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469924#M132246</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;(?i)CPU_COUNT\s+(?P&amp;lt;cpu_cores&amp;gt;[^ \n]*)?
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Apr 2020 06:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469924#M132246</guid>
      <dc:creator>abilann</dc:creator>
      <dc:date>2020-04-08T06:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469925#M132247</link>
      <description>&lt;P&gt;Hi abilann,&lt;/P&gt;

&lt;P&gt;Can you also please post some sample events, because with just the regex it hard to answer. &lt;BR /&gt;
Also, this posted regex is not correct because you have an incomplete group structure and the last &lt;CODE&gt;?&lt;/CODE&gt; does not have a preceding token.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 07:01:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469925#M132247</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2020-04-08T07:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469926#M132248</link>
      <description>&lt;P&gt;Hi @abilann,&lt;BR /&gt;
This is the explanation of your regex by regex101.com:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i) match the remainder of the pattern with the following effective flags: gmi
i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])
CPU_COUNT matches the characters CPU_COUNT literally (case insensitive)
\s+ matches any whitespace character (equal to [\r\n\t\f\v ])
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed (greedy)
Named Capture Group cpu_cores (?P&amp;lt;cpu_cores&amp;gt;[^ \n]*)?
? Quantifier — Matches between zero and one times, as many times as possible, giving back as needed (greedy)
Match a single character not present in the list below [^ \n]*
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
  matches the character   literally (case insensitive)
\n matches a line-feed (newline) character (ASCII 10)
Global pattern flags
g modifier: global. All matches (don't return after first match)
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That you can see by yourself at &lt;A href="https://regex101.com/r/xfUL8y/1"&gt;https://regex101.com/r/xfUL8y/1&lt;/A&gt; .&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 07:03:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469926#M132248</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-04-08T07:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469927#M132249</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;Actually this is the default field extract (hardware : EXTRACT-cpu_cores) used in "Splunk App for AWS". Am trying to understand how they are extracting CPU_Cores from the events. Because I could not find any keyword like "CPU" in the events. &lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Abilan&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:55:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469927#M132249</guid>
      <dc:creator>abilann</dc:creator>
      <dc:date>2020-09-30T04:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469928#M132250</link>
      <description>&lt;P&gt;Hi abilann,&lt;/P&gt;

&lt;P&gt;The regex is looking for a case insensitive match for &lt;CODE&gt;CPU_COUNT&lt;/CODE&gt; followed by one or more whitespace and puts the following characters that are not a new line in a field called &lt;CODE&gt;cpu_cores&lt;/CODE&gt;(in a greedy mode). &lt;/P&gt;

&lt;P&gt;This is a literal translation of the regex.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 08:42:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-understand-Regular-Expression/m-p/469928#M132250</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2020-04-08T08:42:33Z</dc:date>
    </item>
  </channel>
</rss>

