<?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 &amp;quot;myuserid&amp;quot; from my _raw event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341557#M101238</link>
    <description>&lt;P&gt;\n is a string&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2017 15:26:52 GMT</pubDate>
    <dc:creator>sravankaripe</dc:creator>
    <dc:date>2017-03-07T15:26:52Z</dc:date>
    <item>
      <title>How to extract "myuserid" from my _raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341554#M101235</link>
      <description>&lt;P&gt;i want to retrieve myuserid from the  below _raw event. please help me with rex in search. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;name&amp;gt;userid&amp;lt;/name&amp;gt;\n &amp;lt;lvalue&amp;gt;\n &amp;lt;string&amp;gt;myuserid&amp;lt;/string&amp;gt;\n
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 15:03:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341554#M101235</guid>
      <dc:creator>sravankaripe</dc:creator>
      <dc:date>2017-03-07T15:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract "myuserid" from my _raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341555#M101236</link>
      <description>&lt;P&gt;Is it really a &lt;CODE&gt;\n&lt;/CODE&gt; string in your data or they are representing new line? (your data is multiline)? &lt;/P&gt;

&lt;P&gt;Also check if this works&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "\&amp;lt;name\&amp;gt;userid([^\&amp;gt;]+\&amp;gt;){3}(?&amp;lt;userid&amp;gt;[^\&amp;lt;]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 15:23:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341555#M101236</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-07T15:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract "myuserid" from my _raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341556#M101237</link>
      <description>&lt;P&gt;Few assumptions&lt;BR /&gt;
- Hope the above is NOT pure xml?&lt;BR /&gt;
- assuming  is a unique xml tag for myuserid&lt;/P&gt;

&lt;P&gt;the regex is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "\&amp;lt;string\&amp;gt;(?&amp;lt;myuseridValue&amp;gt;.*)\&amp;lt;\/string\&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="&amp;lt;name&amp;gt;userid&amp;lt;/name&amp;gt;\n &amp;lt;lvalue&amp;gt;\n &amp;lt;string&amp;gt;myuserid&amp;lt;/string&amp;gt;\n " | rex field=_raw "\&amp;lt;string\&amp;gt;(?&amp;lt;myuseridValue&amp;gt;.*)\&amp;lt;\/string\&amp;gt;"| table _raw,myuseridValue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 15:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341556#M101237</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-03-07T15:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract "myuserid" from my _raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341557#M101238</link>
      <description>&lt;P&gt;\n is a string&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 15:26:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341557#M101238</guid>
      <dc:creator>sravankaripe</dc:creator>
      <dc:date>2017-03-07T15:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract "myuserid" from my _raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341558#M101239</link>
      <description>&lt;P&gt;Did you try the search I suggested?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:29:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341558#M101239</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-07T17:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract "myuserid" from my _raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341559#M101240</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "(?ms)&amp;lt;name&amp;gt;userid&amp;lt;\/name&amp;gt;[\r\n]*&amp;lt;lvalue&amp;gt;[\r\n]&amp;lt;string&amp;gt;(?&amp;lt;userid&amp;gt;.*)&amp;lt;\/string&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 18:53:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-quot-myuserid-quot-from-my-raw-event/m-p/341559#M101240</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-07T18:53:42Z</dc:date>
    </item>
  </channel>
</rss>

