<?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: Splunk Cloud rex extraction on search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490327#M136927</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw=".sessionid=d2a4f0de-747f-413c-a823-03ee7d241d5b&amp;amp;hash&amp;amp;test"
| rex "sessionid=(?&amp;lt;ABC&amp;gt;.*?)&amp;amp;"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Greedy matching of REGEX is useful.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Mar 2020 11:11:32 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-03-11T11:11:32Z</dc:date>
    <item>
      <title>Splunk Cloud rex extraction on search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490322#M136922</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Attempt A index="w3c" | rex field=_raw "?(sessionid=?)\w{8}-\w{4}-\w{4}-\w{4}-\w{12}"  | table  ABC _raw
Attempt B index="w3c" | rex field=_raw "\.\sessionid\=\"(?P)[\w{8}]-[\w{4}]-[\w{4}]-[\w{4}]-[\w{12}]"  | table  ABC _raw
Attempt C index="w3c" | rex field=_raw "\.\sessionid\=\"(?P[\w{8}]-[\w{4}]-[\w{4}]-[\w{4}]-[\w{12}])"  | table  ABC _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(I used a named field ABC, it gets cut from this post)&lt;/P&gt;

&lt;P&gt;FROM  text:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.sessionid=d2a4f0de-747f-413c-a823-03ee7d241d5b&amp;amp;hash
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The GOAL:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ABC = d2a4f0de-747f-413c-a823-03ee7d241d5b
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Mar 2020 19:41:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490322#M136922</guid>
      <dc:creator>onedarr</dc:creator>
      <dc:date>2020-03-10T19:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Cloud rex extraction on search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490323#M136923</link>
      <description>&lt;P&gt;You can capture all up to the "&amp;amp;". Try this &lt;CODE&gt;index="w3c"| rex "sessionid\=(?&amp;lt;vns_raw&amp;gt;[^\&amp;amp;]+)"&lt;/CODE&gt; Assuming that vns_raw is the field you are wanting to create. Otherwise you can change it to your needs. &lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 21:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490323#M136923</guid>
      <dc:creator>jscraig2006</dc:creator>
      <dc:date>2020-03-10T21:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Cloud rex extraction on search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490324#M136924</link>
      <description>&lt;P&gt;vns was a typo, meant ABC. Thank you for your input, but your expression still returns null for that extracted field. I'm wondering if cloud has some special rules to the rex command? This seems like a bug but I don't have a good way to test in another splunk environment &lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 21:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490324#M136924</guid>
      <dc:creator>onedarr</dc:creator>
      <dc:date>2020-03-10T21:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Cloud rex extraction on search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490325#M136925</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "(\.sessionid=)(?&amp;lt;ABC&amp;gt;(\w*[\-\&amp;amp;]?)+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Mar 2020 22:31:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490325#M136925</guid>
      <dc:creator>anmolpatel</dc:creator>
      <dc:date>2020-03-10T22:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Cloud rex extraction on search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490326#M136926</link>
      <description>&lt;P&gt;I've posted on this topic previously, but one of the best yet most unknown features of Splunk is "erex".&lt;/P&gt;

&lt;P&gt;Pipe the results or your search to erex, and provide a arbitrary name and "examples" (and/or counter-examples) of the value you are trying to extract. Once the search completes, view the job inspector and it will provide you with the proper regex query to extract the field you are after. It is extremely useful! It may not be perfect at first try, but builds the regex for you, then you can tweak and fine tune it (though generally it's pretty spot on).&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/Erex"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/SearchReference/Erex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 04:55:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490326#M136926</guid>
      <dc:creator>codebuilder</dc:creator>
      <dc:date>2020-03-11T04:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Cloud rex extraction on search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490327#M136927</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw=".sessionid=d2a4f0de-747f-413c-a823-03ee7d241d5b&amp;amp;hash&amp;amp;test"
| rex "sessionid=(?&amp;lt;ABC&amp;gt;.*?)&amp;amp;"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Greedy matching of REGEX is useful.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 11:11:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Cloud-rex-extraction-on-search/m-p/490327#M136927</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-11T11:11:32Z</dc:date>
    </item>
  </channel>
</rss>

