<?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: Extract first 3 lines of raw logs and group in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546316#M154864</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233040"&gt;@alex5441&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Please try below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "exception\"\s:\s\"(?&amp;lt;ErrorMsg&amp;gt;.*?)\""
| stats count by Application ErrorMsg 
| sort -count 
| table count, Application, ErrorMsg&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 01 Apr 2021 01:38:21 GMT</pubDate>
    <dc:creator>scelikok</dc:creator>
    <dc:date>2021-04-01T01:38:21Z</dc:date>
    <item>
      <title>Extract first 3 lines of raw logs and group</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546115#M154787</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My current query for splunk dashboard is as:&lt;/P&gt;&lt;P&gt;........| eval ErrorMsg=_raw | stats count by Application, ErrorMsg | sort -count | table count, Application, ErrorMsg&lt;/P&gt;&lt;P&gt;My able looks like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;count&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Application&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;ErrorMsg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;5&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;abc&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;&lt;P&gt;{"severity" : "ERROR", "exception" : "xyz abc asd......."........"time" : "12:00:00"&amp;gt;&amp;lt;there are mutiple key value pairs with data in multiple lines&amp;gt;........}&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;10&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;abc&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;{"severity" : "ERROR", "exception" : "xyz abc asd......."........."time" : "12:01:00"&amp;lt;there are mutiple key value pairs with data in multiple lines&amp;gt;........}&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get table like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;15&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;abc&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;"exception" : "xyz abc asd&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 31 Mar 2021 04:37:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546115#M154787</guid>
      <dc:creator>alex5441</dc:creator>
      <dc:date>2021-03-31T04:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Extract first 3 lines of raw logs and group</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546122#M154791</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233040"&gt;@alex5441&lt;/a&gt;,&lt;BR /&gt;You can extract the values for the field&amp;nbsp;&lt;STRONG&gt;ErrorMsg&lt;/STRONG&gt; using rex command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;........| rex "(?&amp;lt;ErrorMsg&amp;gt;\"exception\"\s:\s\"\w+\s\w+\w\s\w+)" | stats count by Application, ErrorMsg | sort -count | table count, Application, ErrorMsg&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, a like would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 13:58:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546122#M154791</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-03-31T13:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Extract first 3 lines of raw logs and group</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546220#M154830</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply&amp;nbsp; but Nothing changed on table.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 13:54:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546220#M154830</guid>
      <dc:creator>alex5441</dc:creator>
      <dc:date>2021-03-31T13:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extract first 3 lines of raw logs and group</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546222#M154831</link>
      <description>&lt;P&gt;I updated my answer, check now.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 13:59:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546222#M154831</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-03-31T13:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Extract first 3 lines of raw logs and group</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546311#M154861</link>
      <description>&lt;P&gt;Hi manjunathmet,&lt;/P&gt;&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Champion lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;Nothing changed agian. However I think if I get everything extracted value of exception Key that would suffice my requirement.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;{"Severity": "ERROR", "exception":"..................................", "logger":"....................."}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Champion lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;In above pattern I am able to extract with regex:&amp;nbsp; &amp;nbsp;exception":"(.*?)"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Champion lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;But I have to use it as rex in my SPL which needs escaping special chars which I am not sure about.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 22:38:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546311#M154861</guid>
      <dc:creator>alex5441</dc:creator>
      <dc:date>2021-03-31T22:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extract first 3 lines of raw logs and group</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546316#M154864</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233040"&gt;@alex5441&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Please try below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "exception\"\s:\s\"(?&amp;lt;ErrorMsg&amp;gt;.*?)\""
| stats count by Application ErrorMsg 
| sort -count 
| table count, Application, ErrorMsg&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Apr 2021 01:38:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546316#M154864</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-04-01T01:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extract first 3 lines of raw logs and group</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546324#M154868</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | rex "exception\"\s?:\s?\"(?&amp;lt;ErrorMsg&amp;gt;[^\"]+)\"" | stats count by Application, ErrorMsg | sort -count | table count, Application, ErrorMsg&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Apr 2021 05:23:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-first-3-lines-of-raw-logs-and-group/m-p/546324#M154868</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-04-01T05:23:37Z</dc:date>
    </item>
  </channel>
</rss>

