<?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: Can you help me create a regular expression to extract 2 values from a string? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395731#M114896</link>
    <description>&lt;P&gt;With above query getting exact logs, but getting junk logs, due to that my table becomes empty for most of the rows&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jan 2019 14:04:07 GMT</pubDate>
    <dc:creator>arjun_krishna</dc:creator>
    <dc:date>2019-01-10T14:04:07Z</dc:date>
    <item>
      <title>Can you help me create a regular expression to extract 2 values from a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395727#M114892</link>
      <description>&lt;P&gt;log1: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;com.google.AbcdExtension] [mthd] | null - Bound **CLINIC-MBR-GROUP-INC**:23490110094900 -- total execution took **14** seconds
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;log2: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;com.google.AbcdExtension] [mthd] | null - Bound DEAF-RECO:12310110094900 -- writing 3 records took 14 seconds
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;log3: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;com.google.AbcdExtension] [mthd] | val - Bound EYE-TRIO-GRP-INCREMENTAL:201901342421 -- backup strategy execution took 0 seconds
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;log4: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;com.google.AbcdExtension] [mthd] | val - Bound **HOSPITAL-CARE-GROUP**:201123131323 -- total execution took **3425** seconds
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From the above 4 logs, i want to extract log1 and log4 values, like the below table (highlighted)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;HospName                Timee
CLINIC-MBR-GROUP-INC      14
HOSPITAL-CARE-GROUP       3425
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried the below query, but it's giving junk also: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*randix*" source="*.log*" sourcetype="abcd-xyz*" "com.google.AbcdExtension" | rex "- Bound (?&amp;lt;HospName&amp;gt;[^\:]*)" | rex "-- total execution took (?&amp;lt;Timee&amp;gt;[\w]*)" | table HospName Timee
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could you please correct my query&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 12:03:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395727#M114892</guid>
      <dc:creator>arjun_krishna</dc:creator>
      <dc:date>2019-01-10T12:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create a regular expression to extract 2 values from a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395728#M114893</link>
      <description>&lt;P&gt;@arjun_krishna ,&lt;/P&gt;

&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Bound\s(?&amp;lt;HospName&amp;gt;[\w-]+):\d+ -- total execution took\s(?&amp;lt;Time&amp;gt;\d+)\s"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Jan 2019 13:47:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395728#M114893</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-10T13:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create a regular expression to extract 2 values from a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395729#M114894</link>
      <description>&lt;P&gt;I see nothing wrong with your query.  Like @renjith.nair said, you could use &lt;CODE&gt;\d&lt;/CODE&gt; instead of &lt;CODE&gt;\w&lt;/CODE&gt;, but both should work.  What results are you getting and what are you expecting?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 13:48:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395729#M114894</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-01-10T13:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create a regular expression to extract 2 values from a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395730#M114895</link>
      <description>&lt;P&gt;Could you explain how we know for sure which entries are junk and which entries are not junk?  It is just those two things, "CLINIC-MBR-GROUP-INC" and "HOSPITAL-CARE-GROUP" that are OK, and &lt;EM&gt;everything else&lt;/EM&gt; is junk, or is it that EYE* and DEAF* are junk and everything else is good?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 13:50:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395730#M114895</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2019-01-10T13:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create a regular expression to extract 2 values from a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395731#M114896</link>
      <description>&lt;P&gt;With above query getting exact logs, but getting junk logs, due to that my table becomes empty for most of the rows&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 14:04:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395731#M114896</guid>
      <dc:creator>arjun_krishna</dc:creator>
      <dc:date>2019-01-10T14:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create a regular expression to extract 2 values from a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395732#M114897</link>
      <description>&lt;P&gt;"Bound\s(?[\w-]+):\d+ -- total execution took\s(?\d+)\s"&lt;BR /&gt;
with this query i am exacting the required HospName, TIme attribues , but in table representation getting other logs too. due to this table becomes empty for most rows&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 14:07:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395732#M114897</guid>
      <dc:creator>arjun_krishna</dc:creator>
      <dc:date>2019-01-10T14:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create a regular expression to extract 2 values from a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395733#M114898</link>
      <description>&lt;P&gt;Ok, just add "total execution took" this to your base search to filter only those events where you have values&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*randix*" source="*.log*" sourcetype="abcd-xyz*" "com.google.AbcdExtension" "total execution took"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Jan 2019 14:16:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395733#M114898</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-10T14:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create a regular expression to extract 2 values from a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395734#M114899</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index="*randix*" source="*.log*" sourcetype="abcd-xyz*" "com.google.AbcdExtension" | rex "- Bound (?&amp;lt;HospName&amp;gt;[^\:]*)" | rex "-- total execution took (?&amp;lt;Timee&amp;gt;[\w]*)" | search HospName=* | table HospName Timee
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which just searches for the ones where HospName is in the data, after you've extracted?&lt;/P&gt;

&lt;P&gt;You could flip that and just search for the data you want first, then extract:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*randix*" source="*.log*" sourcetype="abcd-xyz*" "com.google.AbcdExtension" ("HOSPITAL-CARE-GROUP" OR  "CLINIC-MBR-GROUP-INC")
| rex "- Bound (?&amp;lt;HospName&amp;gt;[^\:]*)" | rex "-- total execution took (?&amp;lt;Timee&amp;gt;[\w]*)" | table HospName Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;NOTE in both cases I did not make any other changes to your extraction or search, just copied and pasted it from above so you can compare and see what I did.  It might work as is, but also there are other suggestions for chunks of it that people have already posted - those might work better with the additions I made.  &lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 14:40:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395734#M114899</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2019-01-10T14:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create a regular expression to extract 2 values from a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395735#M114900</link>
      <description>&lt;P&gt;Thanks for the help @renjith.nair , I want ti take a timechart/linechart to get HospName is x-axis and Time (the time taken for each) in y-axis&lt;/P&gt;

&lt;P&gt;I have tried below&lt;BR /&gt;
&lt;CODE&gt;|timechart count by HospName, Time&lt;/CODE&gt; but not getting any chart&lt;BR /&gt;
Please help me on this&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 10:10:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395735#M114900</guid>
      <dc:creator>arjun_krishna</dc:creator>
      <dc:date>2019-01-11T10:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me create a regular expression to extract 2 values from a string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395736#M114901</link>
      <description>&lt;P&gt;@arjun_krishna , timechart is for plotting the values over  a period of time. In your case , &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;chart max(Time) by HostName&lt;/CODE&gt; should work&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 10:37:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-create-a-regular-expression-to-extract-2-values/m-p/395736#M114901</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-11T10:37:30Z</dc:date>
    </item>
  </channel>
</rss>

