<?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: I want to extract information from this field within these specific parameters using a rex command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/I-want-to-extract-information-from-this-field-within-these/m-p/291642#M88089</link>
    <description>&lt;P&gt;try this,&lt;/P&gt;

&lt;P&gt;| makeresults | eval tst="POST /services/api/cumulativeLogo?trespassxyz#POST /services/api/cumulativeLogosag#POST /services/api/cumulativeLogosamplefull.lopend.parameter" | eval tst=split(tst,"#") | mvexpand tst | rex field=tst "(?&amp;lt;exValue&amp;gt;\S+.*)(\?|sag|$)"&lt;/P&gt;</description>
    <pubDate>Wed, 16 Aug 2017 17:48:51 GMT</pubDate>
    <dc:creator>sbbadri</dc:creator>
    <dc:date>2017-08-16T17:48:51Z</dc:date>
    <item>
      <title>I want to extract information from this field within these specific parameters using a rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-want-to-extract-information-from-this-field-within-these/m-p/291640#M88087</link>
      <description>&lt;P&gt;Hi Splunker,&lt;/P&gt;

&lt;P&gt;I wanted to use a rex command until Splunk can find below parameter in logs:&lt;BR /&gt;
1) ? &lt;BR /&gt;
2) sag &lt;BR /&gt;
3) If both of the options are not there then full statement until the end to be extracted.&lt;/P&gt;

&lt;P&gt;My Logs look like this. Any one of the example can come in my logs&lt;/P&gt;

&lt;P&gt;Ex-1 "POST /services/api/cumulativeLogo?trespassxyz   (I want data to be rexed as  &lt;STRONG&gt;POST /services/api/cumulativeLogo&lt;/STRONG&gt;)&lt;BR /&gt;
Ex-2 "POST /services/api/cumulativeLogosag  (data to be looked as &lt;STRONG&gt;POST /services/api/cumulativeLogo&lt;/STRONG&gt;)&lt;BR /&gt;
Ex-3  "POST /services/api/cumulativeLogosamplefull.lopend.parameter (&lt;STRONG&gt;data to be rexed as POST /services/api/cumulativeLogosamplefull.lopend.parameter&lt;/STRONG&gt; ) &lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 16:47:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-want-to-extract-information-from-this-field-within-these/m-p/291640#M88087</guid>
      <dc:creator>m7787579</dc:creator>
      <dc:date>2017-08-16T16:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: I want to extract information from this field within these specific parameters using a rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-want-to-extract-information-from-this-field-within-these/m-p/291641#M88088</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search  | rex "\"(?&amp;lt;URI&amp;gt;.+)(\?|sag|$)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See it working with sample data here: &lt;A href="https://regex101.com/r/ApNEXM/1"&gt;https://regex101.com/r/ApNEXM/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 17:36:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-want-to-extract-information-from-this-field-within-these/m-p/291641#M88088</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-16T17:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: I want to extract information from this field within these specific parameters using a rex command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-want-to-extract-information-from-this-field-within-these/m-p/291642#M88089</link>
      <description>&lt;P&gt;try this,&lt;/P&gt;

&lt;P&gt;| makeresults | eval tst="POST /services/api/cumulativeLogo?trespassxyz#POST /services/api/cumulativeLogosag#POST /services/api/cumulativeLogosamplefull.lopend.parameter" | eval tst=split(tst,"#") | mvexpand tst | rex field=tst "(?&amp;lt;exValue&amp;gt;\S+.*)(\?|sag|$)"&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 17:48:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-want-to-extract-information-from-this-field-within-these/m-p/291642#M88089</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-08-16T17:48:51Z</dc:date>
    </item>
  </channel>
</rss>

