<?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 How do I write a regular expression to return a matching pattern in my logs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261567#M78502</link>
    <description>&lt;P&gt;Any string starting with COLDAPP , ending with double colon, would be a Tx id in my logs. it can be at the beginning/middle/end as the logs are not fully structured always. How do i write a regex to return a matching pattern starting with a COLDAPP and ends with double colon, excluding the double colon in returned pattern.&lt;/P&gt;

&lt;P&gt;Example of log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; BaseProcessor pool-62-thread-84 - COLDAPP_WS_780144376_148455147959900002_pbv14slm2_12910::3tWofZ2Bb
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am trying &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;COLDAPP(?P.*?)::
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it returns&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; _WS_780144376_148455147959900002_pbv14slm2_12910
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do i return&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;COLDAPP_WS_780144376_148455147959900002_pbv14slm2_12910
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2017 17:14:07 GMT</pubDate>
    <dc:creator>pradjswl</dc:creator>
    <dc:date>2017-01-26T17:14:07Z</dc:date>
    <item>
      <title>How do I write a regular expression to return a matching pattern in my logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261567#M78502</link>
      <description>&lt;P&gt;Any string starting with COLDAPP , ending with double colon, would be a Tx id in my logs. it can be at the beginning/middle/end as the logs are not fully structured always. How do i write a regex to return a matching pattern starting with a COLDAPP and ends with double colon, excluding the double colon in returned pattern.&lt;/P&gt;

&lt;P&gt;Example of log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; BaseProcessor pool-62-thread-84 - COLDAPP_WS_780144376_148455147959900002_pbv14slm2_12910::3tWofZ2Bb
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am trying &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;COLDAPP(?P.*?)::
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it returns&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; _WS_780144376_148455147959900002_pbv14slm2_12910
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do i return&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;COLDAPP_WS_780144376_148455147959900002_pbv14slm2_12910
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 17:14:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261567#M78502</guid>
      <dc:creator>pradjswl</dc:creator>
      <dc:date>2017-01-26T17:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write a regular expression to return a matching pattern in my logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261568#M78503</link>
      <description>&lt;P&gt;(COLDAPP?P.*)::&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 17:19:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261568#M78503</guid>
      <dc:creator>dtregonning_spl</dc:creator>
      <dc:date>2017-01-26T17:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write a regular expression to return a matching pattern in my logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261569#M78504</link>
      <description>&lt;P&gt;@dtregonning_splunk somwhow its not working. I am trying my query on regex101.com. Is there anything wrong I would b doing ?&lt;/P&gt;

&lt;P&gt;PS: I was trying to attach a snap, but i got message I would need more karma point to attach image in the post.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 20:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261569#M78504</guid>
      <dc:creator>pradjswl</dc:creator>
      <dc:date>2017-01-26T20:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write a regular expression to return a matching pattern in my logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261570#M78505</link>
      <description>&lt;P&gt;Hmm, im not sure @pradjswl. Look for any trailing or leading spaces. here is a screenshot of what i had.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2390i8C2C74C4BEDA8A6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 22:35:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261570#M78505</guid>
      <dc:creator>dtregonning_spl</dc:creator>
      <dc:date>2017-01-26T22:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write a regular expression to return a matching pattern in my logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261571#M78506</link>
      <description>&lt;P&gt;@dtregonning_splunk how/where do i specify the name of extracted filed in this format ? on regex portal it does return the correct value. How would this work in splunk, as I understand we need to specify the extracted filed name in the query it self with triangular bracket. I tried putting triangular bracket in the query but getting syntax error.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 17:02:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261571#M78506</guid>
      <dc:creator>pradjswl</dc:creator>
      <dc:date>2017-01-27T17:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write a regular expression to return a matching pattern in my logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261572#M78507</link>
      <description>&lt;P&gt;(?COLDAPP?P.*)::&lt;/P&gt;

&lt;P&gt;replace field_name_xxx to whatever you would like to call the extraction field.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:42:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261572#M78507</guid>
      <dc:creator>dtregonning_spl</dc:creator>
      <dc:date>2020-09-29T12:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write a regular expression to return a matching pattern in my logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261573#M78508</link>
      <description>&lt;P&gt;@dtregonning_splunk some how splunk comment omits the fieldname while we comment. I see it was omitted in the question I posted, and the response you are posting. It would be a great if you can post a screenshot with field name.&lt;/P&gt;

&lt;P&gt;I truly appreciate your help.&lt;/P&gt;

&lt;P&gt;By the way how much point do i need to earn before I can start posting images in the comment?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 15:50:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261573#M78508</guid>
      <dc:creator>pradjswl</dc:creator>
      <dc:date>2017-02-06T15:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write a regular expression to return a matching pattern in my logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261574#M78509</link>
      <description>&lt;P&gt;sorry @pradjswl looks like the comment interpreted my text as html. Here is a screenshot showing the regex&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2391i47160D244B1343A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 18:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261574#M78509</guid>
      <dc:creator>dtregonning_spl</dc:creator>
      <dc:date>2017-02-06T18:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write a regular expression to return a matching pattern in my logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261575#M78510</link>
      <description>&lt;P&gt;great, that works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 20:30:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261575#M78510</guid>
      <dc:creator>pradjswl</dc:creator>
      <dc:date>2017-02-06T20:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write a regular expression to return a matching pattern in my logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261576#M78511</link>
      <description>&lt;P&gt;@pradjswl - 60 Karma points are required to attach files. Here's a &lt;A href="http://docs.splunk.com/Documentation/Splunkbase/splunkbase/Answers/HowtoearnKarma"&gt;general outline&lt;/A&gt; of how to earn Karma points on Answers as well as how much Karma is required in order to unlock certain site capabilities.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2017 05:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-write-a-regular-expression-to-return-a-matching-pattern/m-p/261576#M78511</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-02-12T05:33:01Z</dc:date>
    </item>
  </channel>
</rss>

