<?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: creating a new field using Regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378140#M169767</link>
    <description>&lt;P&gt;same position yes but not same letter,  this is another example " cpe:/a:microsoft:malicious_software_removal_tool" so I'm looking for a way to distinguish between cpe:/o and cpe:/a&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 19:23:22 GMT</pubDate>
    <dc:creator>mr_t2083</dc:creator>
    <dc:date>2020-09-29T19:23:22Z</dc:date>
    <item>
      <title>creating a new field using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378136#M169763</link>
      <description>&lt;P&gt;how do you create a field using regex with the following example below&lt;BR /&gt;
for example &lt;/P&gt;

&lt;P&gt;exsamplefield=cpe:/o:microsoft:windows&lt;/P&gt;

&lt;P&gt;I would like to extract microsoft from the above field?&lt;/P&gt;

&lt;P&gt;What would be proper regex used to extract this?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 20:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378136#M169763</guid>
      <dc:creator>mr_t2083</dc:creator>
      <dc:date>2018-04-30T20:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: creating a new field using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378137#M169764</link>
      <description>&lt;P&gt;To build a proper regex, you need to describe your data properly, it has to have some reliable characteristics.&lt;BR /&gt;
With your example above, multiple characteristics are possible, but without further example data it's hard to find those similarities.&lt;/P&gt;

&lt;P&gt;This is an example: &lt;CODE&gt;^[^:]+:[^:]+:(?&amp;lt;yourfield&amp;gt;[^:]+:)&lt;/CODE&gt;&lt;BR /&gt;
This one would assume that there is always to parts in that field, seperated by &lt;CODE&gt;:&lt;/CODE&gt;, and the value you want to extract is between the second and third &lt;CODE&gt;:&lt;/CODE&gt;. If that's true - here's your regex &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 20:57:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378137#M169764</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-04-30T20:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: creating a new field using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378138#M169765</link>
      <description>&lt;P&gt;Hi mr_t2083&lt;/P&gt;

&lt;P&gt;Please use this REX,&lt;/P&gt;

&lt;P&gt;am uploading pic as this page will try to remove some characters from REX if directly posted.&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4893i58D653EE879F0EB7/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&amp;amp; if you want to apply Rex to field itself, refer to this second pic&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4894i6EE75C29A8ED04B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 21:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378138#M169765</guid>
      <dc:creator>PowerPacked</dc:creator>
      <dc:date>2018-04-30T21:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: creating a new field using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378139#M169766</link>
      <description>&lt;P&gt;Will it always be in same position?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 21:35:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378139#M169766</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-30T21:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: creating a new field using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378140#M169767</link>
      <description>&lt;P&gt;same position yes but not same letter,  this is another example " cpe:/a:microsoft:malicious_software_removal_tool" so I'm looking for a way to distinguish between cpe:/o and cpe:/a&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378140#M169767</guid>
      <dc:creator>mr_t2083</dc:creator>
      <dc:date>2020-09-29T19:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: creating a new field using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378141#M169768</link>
      <description>&lt;P&gt;Have you tried any of solution below? They both should work for you. If you want little more specific regex based on your data, you can try this &lt;CODE&gt;cpe\:\/(o|a)\:(?&amp;lt;YourFieldName&amp;gt;[^\:]+)&lt;/CODE&gt;. (Basically look for either cpe:/a: or cpe:/o: and capture everything after that till next colon)&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 14:16:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378141#M169768</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-01T14:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: creating a new field using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378142#M169769</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=exsamplefield="^(?:[^:]*:){2}(?&amp;lt;YourNameHere&amp;gt;[^:]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 14:50:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378142#M169769</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-05-01T14:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: creating a new field using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378143#M169770</link>
      <description>&lt;P&gt;cpe:\/(a|o):(?\w+):.*&lt;/P&gt;

&lt;P&gt;microsoft will be captured in the named group &lt;/P&gt;

&lt;P&gt;For testing, try &lt;A href="http://www.regex101.com"&gt;www.regex101.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 15:19:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378143#M169770</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-05-01T15:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: creating a new field using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378144#M169771</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;cpe:\/(a|o):(?&amp;lt;fieldname&amp;gt;\w+):.*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 15:19:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-new-field-using-Regex/m-p/378144#M169771</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-05-01T15:19:42Z</dc:date>
    </item>
  </channel>
</rss>

