<?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 extract a field that appears in 3 different formats? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-that-appears-in-3-different-formats/m-p/285129#M86240</link>
    <description>&lt;P&gt;Hi Bagaboo,&lt;/P&gt;

&lt;P&gt;based on the examples, try this regex as your field extraction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Aa]ctivity[iIdD]+[\s:_]+(?&amp;lt;ActivityID&amp;gt;)[^$]+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can verify it first in a search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search here | rex "[Aa]ctivity[iIdD]+[\s:_]+(?&amp;lt;ActivityID&amp;gt;)[^$]+" | do more stuff 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Sun, 20 Dec 2015 21:08:42 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2015-12-20T21:08:42Z</dc:date>
    <item>
      <title>How to extract a field that appears in 3 different formats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-that-appears-in-3-different-formats/m-p/285128#M86239</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I am using Splunk Light to create a proof of concept with Splunk. &lt;/P&gt;

&lt;P&gt;I have imported a .csv file. One of the columns has a "message". &lt;BR /&gt;
The message sometimes contains an ActivityID. &lt;BR /&gt;
The ActivityID has three inconsistent shapes:&lt;BR /&gt;
 1. ActivityID: 00000000-0000-0000-0000-000000000000&lt;BR /&gt;
 2. ActivityID 00000000-0000-0000-0000-000000000000&lt;BR /&gt;
 3. activityid_00000000-0000-0000-0000-000000000000&lt;/P&gt;

&lt;P&gt;I want to extract the field based on the above. &lt;/P&gt;

&lt;P&gt;I succeeded to extract the first one. When I add the second one, it fails to do so and throws an error. &lt;BR /&gt;
I tried to create two different definitions with the same name. The seconds one fails because ActivityID already exists. &lt;/P&gt;

&lt;P&gt;What are your recommendations?&lt;/P&gt;</description>
      <pubDate>Sun, 20 Dec 2015 19:52:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-that-appears-in-3-different-formats/m-p/285128#M86239</guid>
      <dc:creator>Bagaboo</dc:creator>
      <dc:date>2015-12-20T19:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field that appears in 3 different formats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-that-appears-in-3-different-formats/m-p/285129#M86240</link>
      <description>&lt;P&gt;Hi Bagaboo,&lt;/P&gt;

&lt;P&gt;based on the examples, try this regex as your field extraction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Aa]ctivity[iIdD]+[\s:_]+(?&amp;lt;ActivityID&amp;gt;)[^$]+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can verify it first in a search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search here | rex "[Aa]ctivity[iIdD]+[\s:_]+(?&amp;lt;ActivityID&amp;gt;)[^$]+" | do more stuff 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sun, 20 Dec 2015 21:08:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-that-appears-in-3-different-formats/m-p/285129#M86240</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-12-20T21:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field that appears in 3 different formats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-that-appears-in-3-different-formats/m-p/285130#M86241</link>
      <description>&lt;P&gt;Thank you MuS. Based on your input i tried...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Aa]ctivity[iIdD]+[\s:_]+(?P&amp;lt;ActivityID&amp;gt;[^,]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...and it worked like a charm. It is extracting all three field variants and getting me the guids flawlessly. Although i got different results when i tried it in the search. &lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 17:43:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-that-appears-in-3-different-formats/m-p/285130#M86241</guid>
      <dc:creator>Bagaboo</dc:creator>
      <dc:date>2015-12-21T17:43:15Z</dc:date>
    </item>
  </channel>
</rss>

