<?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: Regex to  extract two strings from log and make as field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312629#M93605</link>
    <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=app source=/var/log* "#xHoster#" 
| rex field=_raw  "#(?&amp;lt;ptype&amp;gt;res_[^#]+)#.+\-\&amp;gt;\s*(?&amp;lt;ptime&amp;gt;\d+)\s*milliseconds" 
| table ptype ptime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Feb 2017 13:12:46 GMT</pubDate>
    <dc:creator>rjthibod</dc:creator>
    <dc:date>2017-02-21T13:12:46Z</dc:date>
    <item>
      <title>Regex to  extract two strings from log and make as field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312628#M93604</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Log - (given 2 lines for example)&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017/02/21 03:46:12.119-0800 [http-bio-8480-exec-3] C3AF4B3F9C2E40D2006D1513C81191A6.pppxwbtect014 INFO  c.e.c.w.b.r.ShirtsSaleResource -  #xHoster#  #**res_ShirtServiceTosite**#  ShirtsSaleResource.getLossier  , URI -&amp;gt;  /{1856659}  , Time taken to get JSON -&amp;gt; **58** milliseconds

2017/02/21 03:46:08.489-0800 [http-bio-8480-exec-2] 82F757837394C2E950AEB9A47043DD61.pppxwbtect010 INFO  c.e.c.p.m.i.CmppRestClientImpl -  #xHoster#  #**res_CmppToShirtService**#  CmppRestClientImpl.prepareChange  , URI -&amp;gt; &lt;A href="http://ppp-Shirteu.ch.expeso.com:52008/order/PrepareChange" target="test_blank"&gt;http://ppp-Shirteu.ch.expeso.com:52008/order/PrepareChange&lt;/A&gt; , Time taken to get XML response -&amp;gt;  **178** milliseconds
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Expected output :&lt;/STRONG&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Field1                            Field2
res_ShirtServiceToSite            58
res_CmppToShirtService            178
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;I tried :&lt;/STRONG&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=app source=/var/log* "#xHoster#" | rex field=_raw res_(?.*)# | rex field=_raw .\-\&amp;gt;\s(?.*)\smilliseconds |table ptype,ptime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Feb 2017 12:08:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312628#M93604</guid>
      <dc:creator>pingdpk</dc:creator>
      <dc:date>2017-02-21T12:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to  extract two strings from log and make as field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312629#M93605</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=app source=/var/log* "#xHoster#" 
| rex field=_raw  "#(?&amp;lt;ptype&amp;gt;res_[^#]+)#.+\-\&amp;gt;\s*(?&amp;lt;ptime&amp;gt;\d+)\s*milliseconds" 
| table ptype ptime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Feb 2017 13:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312629#M93605</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-02-21T13:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to  extract two strings from log and make as field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312630#M93606</link>
      <description>&lt;P&gt;I came up with &lt;CODE&gt;\*\*(?&amp;lt;ptype&amp;gt;res_[^\*]+)\*\*.*?\*\*(?&amp;lt;ptime&amp;gt;\d+)\*\*&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 13:45:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312630#M93606</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2017-02-21T13:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to  extract two strings from log and make as field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312631#M93607</link>
      <description>&lt;P&gt;How about this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "(?res_[^*]+)" | rex field=_raw "\*(?\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Feb 2017 19:49:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312631#M93607</guid>
      <dc:creator>nikhilb0763</dc:creator>
      <dc:date>2017-02-22T19:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to  extract two strings from log and make as field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312632#M93608</link>
      <description>&lt;P&gt;Here's my RegEx:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?P&amp;lt;ptype&amp;gt;res_\w+).*\*\*(?P&amp;lt;ptime&amp;gt;\d+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Feb 2017 22:03:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312632#M93608</guid>
      <dc:creator>zanb</dc:creator>
      <dc:date>2017-02-22T22:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to  extract two strings from log and make as field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312633#M93609</link>
      <description>&lt;P&gt;@pingdpk - Looks like you have a few possible solutions to your question. If one of them provided a working solution, please don't forget to click "Accept" below the best answer to resolve this post. If you still need help, please leave a comment. Don’t forget to upvote anything that was helpful too. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 00:58:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-extract-two-strings-from-log-and-make-as-field/m-p/312633#M93609</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-04-20T00:58:18Z</dc:date>
    </item>
  </channel>
</rss>

