<?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 find string between two given strings in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/find-string-between-two-given-strings-in-splunk/m-p/20240#M3131</link>
    <description>&lt;P&gt;How i can get the string between two given strings.&lt;/P&gt;

&lt;P&gt;Log has entires like &lt;/P&gt;

&lt;P&gt;22:09: DT : &lt;STRONG&gt;2178we352njsdfh48734&lt;/STRONG&gt; : EF and so on.&lt;/P&gt;

&lt;P&gt;I want to find fetch the values between "DT :" and ": EF". The  "2178we352njsdfh48734" will vary based on the request and the "DT :" and ": EF": will remain same for all the request.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jan 2011 19:33:13 GMT</pubDate>
    <dc:creator>suruthyshree</dc:creator>
    <dc:date>2011-01-04T19:33:13Z</dc:date>
    <item>
      <title>find string between two given strings in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-string-between-two-given-strings-in-splunk/m-p/20240#M3131</link>
      <description>&lt;P&gt;How i can get the string between two given strings.&lt;/P&gt;

&lt;P&gt;Log has entires like &lt;/P&gt;

&lt;P&gt;22:09: DT : &lt;STRONG&gt;2178we352njsdfh48734&lt;/STRONG&gt; : EF and so on.&lt;/P&gt;

&lt;P&gt;I want to find fetch the values between "DT :" and ": EF". The  "2178we352njsdfh48734" will vary based on the request and the "DT :" and ": EF": will remain same for all the request.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2011 19:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-string-between-two-given-strings-in-splunk/m-p/20240#M3131</guid>
      <dc:creator>suruthyshree</dc:creator>
      <dc:date>2011-01-04T19:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: find string between two given strings in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-string-between-two-given-strings-in-splunk/m-p/20241#M3132</link>
      <description>&lt;P&gt;Generally, you want to either use &lt;A href="http://www.splunk.com/base/Documentation/4.1.6/User/ExtractFieldsWithSearchCommands" rel="nofollow"&gt;&lt;CODE&gt;rex&lt;/CODE&gt;&lt;/A&gt; or create a dedicated &lt;A href="http://www.splunk.com/base/Documentation/latest/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles" rel="nofollow"&gt;field extraction&lt;/A&gt;.  For more complete information, look &lt;A href="http://www.splunk.com/base/Documentation/4.1.6/User/ExtractNewFields" rel="nofollow"&gt;here&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;Using rex:&lt;/P&gt;

&lt;P&gt;In the search string, add the following to your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=xx "^\d+:\d+: DT : (?&amp;lt;txid&amp;gt;.*?) : EF"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;
For something more permanent, you can use:&lt;/P&gt;

&lt;P&gt;&lt;B&gt;transforms.conf&lt;/B&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mytxid]
REGEX = "^\d+:\d+: DT : (.*?) : EF"
FORMAT = txid::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;B&gt;props.conf&lt;/B&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
REPORT-txid = mytxid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Jan 2011 00:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-string-between-two-given-strings-in-splunk/m-p/20241#M3132</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2011-01-05T00:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: find string between two given strings in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-string-between-two-given-strings-in-splunk/m-p/20242#M3133</link>
      <description>&lt;P&gt;"search string" | rex field=_raw "DT : (?P[^\s]+) : EF" | dedup txid| table txid&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 14:55:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-string-between-two-given-strings-in-splunk/m-p/20242#M3133</guid>
      <dc:creator>siri1410</dc:creator>
      <dc:date>2017-10-27T14:55:57Z</dc:date>
    </item>
  </channel>
</rss>

