<?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 data using rex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/532597#M150455</link>
    <description>&lt;P&gt;thank you &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/136781"&gt;@renjith_nair&lt;/a&gt;&amp;nbsp;for help.&amp;nbsp; now im again trying to extract&amp;nbsp;correlation_id as&amp;nbsp;&lt;SPAN&gt;CorrelationId4.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"data":{"correlation_id":"51g0d88f-3ab8-4mom-betb-b31ed6e1662z","u_originator_uri"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;i used following query to extract value:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; | rex "\{\"correlation\_id\"\:\"(?&amp;lt;CorrelationId4&amp;gt;[^\&amp;lt;]*)\s*\""&lt;/LI-CODE&gt;&lt;P&gt;but now, i am not getting field as CorrelationId4. request you to guide further on this&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2020 08:09:39 GMT</pubDate>
    <dc:creator>Learner</dc:creator>
    <dc:date>2020-12-10T08:09:39Z</dc:date>
    <item>
      <title>How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531622#M150148</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I am having data as follows:&lt;/P&gt;
&lt;P&gt;REPORT RequestId: xxxx2722-xx0d-xx35-95xx-xxxxxxb6b2e1&lt;/P&gt;
&lt;P&gt;i want a field as CorrelationId3 which is having&amp;nbsp;xxxx2722-xx0d-xx35-95xx-xxxxxxb6b2e1 value&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 03:57:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531622#M150148</guid>
      <dc:creator>Learner</dc:creator>
      <dc:date>2020-12-02T03:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531633#M150152</link>
      <description>&lt;P&gt;Do you have any characters/strings after the value ?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your search
|rex "RequestId:\s+(?&amp;lt;CorrelationId3&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;If you have any chars after the value , add them after the last parenthesis (")")&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 05:46:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531633#M150152</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-12-02T05:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531646#M150154</link>
      <description>&lt;P&gt;there is more raw data after&amp;nbsp;&lt;SPAN&gt;xxxx2722-xx0d-xx35-95xx-xxxxxxb6b2e1 as 'xxxx2722-xx0d-xx35-95xx-xxxxxxb6b2e1 Duration ---'. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;after using using your query, i'm getting data as 'xxxx2722-xx0d-xx35-95xx-xxxxxxb6b2e1 Duration ---' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but i want data as 'xxxx2722-xx0d-xx35-95xx-xxxxxxb6b2e1'&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 07:24:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531646#M150154</guid>
      <dc:creator>Learner</dc:creator>
      <dc:date>2020-12-02T07:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531648#M150155</link>
      <description>&lt;P&gt;As mentioned, have you tried adding that string after the parenthesis?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|rex RequestId:\s+(?&amp;lt;CorrelationId3&amp;gt;[^\s]+)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 10:52:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531648#M150155</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-12-02T10:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531650#M150156</link>
      <description>&lt;P&gt;yes, but still not getting right answer. i guess there is tab space rather than blank space before Duration. if tab, then how to write that?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 07:58:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531650#M150156</guid>
      <dc:creator>Learner</dc:creator>
      <dc:date>2020-12-02T07:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531658#M150159</link>
      <description>&lt;P&gt;Edited the first answer and should work for space and tabs&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|rex "RequestId:\s+(?&amp;lt;CorrelationId3&amp;gt;[^\s]+)"&lt;/LI-CODE&gt;&lt;P&gt;If the format of the string is only letters,numbers and - then ,you may use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|rex "RequestId:\s+(?&amp;lt;CorrelationId3&amp;gt;[a-z0-9A-Z-]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 10:53:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/531658#M150159</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-12-02T10:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/532597#M150455</link>
      <description>&lt;P&gt;thank you &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/136781"&gt;@renjith_nair&lt;/a&gt;&amp;nbsp;for help.&amp;nbsp; now im again trying to extract&amp;nbsp;correlation_id as&amp;nbsp;&lt;SPAN&gt;CorrelationId4.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"data":{"correlation_id":"51g0d88f-3ab8-4mom-betb-b31ed6e1662z","u_originator_uri"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;i used following query to extract value:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; | rex "\{\"correlation\_id\"\:\"(?&amp;lt;CorrelationId4&amp;gt;[^\&amp;lt;]*)\s*\""&lt;/LI-CODE&gt;&lt;P&gt;but now, i am not getting field as CorrelationId4. request you to guide further on this&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 08:09:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/532597#M150455</guid>
      <dc:creator>Learner</dc:creator>
      <dc:date>2020-12-10T08:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/532609#M150457</link>
      <description>&lt;P&gt;try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;correlation_id\":\"(?&amp;lt;CorrelationId4&amp;gt;[^\"]+)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Dec 2020 09:42:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/532609#M150457</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-12-10T09:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/532667#M150479</link>
      <description>&lt;P&gt;not getting the data.&lt;/P&gt;&lt;P&gt;what if data is like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"{\"data\":{\"correlation_id:\"51g0d88f-3ab8-4mom-betb-b31ed6e1662z\",\"u_originator_uri&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/532667#M150479</guid>
      <dc:creator>Learner</dc:creator>
      <dc:date>2020-12-10T15:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/533676#M150808</link>
      <description>&lt;P&gt;not getting the data&lt;/P&gt;</description>
      <pubDate>Sun, 20 Dec 2020 15:21:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/533676#M150808</guid>
      <dc:creator>Learner</dc:creator>
      <dc:date>2020-12-20T15:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/533688#M150812</link>
      <description>&lt;P&gt;i have tried&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "correlation_id\\":\\"(?&amp;lt;CorrelationId4&amp;gt;[^\"]+)\\"&lt;/LI-CODE&gt;&lt;P&gt;but it gives me error as&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Error in 'rex' command: Encountered the following error while compiling the regex 'correlation_id\:\(?&amp;lt;CorrelationId4&amp;gt;[^"]+)\': Regex: unmatched closing parenthesis.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 04:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/533688#M150812</guid>
      <dc:creator>Learner</dc:creator>
      <dc:date>2020-12-21T04:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/533702#M150815</link>
      <description>&lt;P&gt;1. You dont need to use \\ but only single \&lt;/P&gt;&lt;P&gt;2. The last quote (") should not be escaped with \\&lt;/P&gt;&lt;P&gt;Please see below sample&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults|eval _raw="{\"data\":{\"correlation_id\":\"51g0d88f-3ab8-4mom-betb-b31ed6e1662z\",\"u_originator_uri\""
|rex "correlation_id\":\"(?&amp;lt;CorrelationId4&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Dec 2020 06:48:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-using-rex/m-p/533702#M150815</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-12-21T06:48:51Z</dc:date>
    </item>
  </channel>
</rss>

