<?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: help to build the query using abstract command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369973#M162099</link>
    <description>&lt;P&gt;Isn't that what you asked for? ("want only the first lines")  If you want more than one line, change the "1" to the desired number.&lt;/P&gt;

&lt;P&gt;If it's something else you seek, please clarify the question.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Mar 2018 14:04:42 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2018-03-21T14:04:42Z</dc:date>
    <item>
      <title>help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369970#M162096</link>
      <description>&lt;P&gt;base query | regex field= "XXX*(?.*)" | stats count by regular_expression_value&lt;/P&gt;

&lt;P&gt;this query displaying 5 lines but want only the first lines&lt;/P&gt;

&lt;P&gt;how to get using abstract  maxlines=1&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:36:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369970#M162096</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2020-09-29T18:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369971#M162097</link>
      <description>&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base query | regex field= "XXX*(?.*)" | stats count by regular_expression_value | head 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Mar 2018 12:59:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369971#M162097</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-21T12:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369972#M162098</link>
      <description>&lt;P&gt;it wont work..it provide table with one result&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 13:04:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369972#M162098</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-03-21T13:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369973#M162099</link>
      <description>&lt;P&gt;Isn't that what you asked for? ("want only the first lines")  If you want more than one line, change the "1" to the desired number.&lt;/P&gt;

&lt;P&gt;If it's something else you seek, please clarify the question.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 14:04:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369973#M162099</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-21T14:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369974#M162100</link>
      <description>&lt;P&gt;Actually i have regular expression and displaying the value&lt;BR /&gt;
that value have 5 lines. i want to reduce that using the abstract command &lt;BR /&gt;
how to do that&lt;/P&gt;

&lt;P&gt;base query | regex field= "XXX*(?.*)" | stats count by regular_expression_value&lt;/P&gt;

&lt;P&gt;regular_expression_value count&lt;BR /&gt;
5 lines                                      4&lt;BR /&gt;
3 lines                                       8&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:37:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369974#M162100</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2020-09-29T18:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369975#M162101</link>
      <description>&lt;P&gt;The &lt;CODE&gt;abstract&lt;/CODE&gt; command is for text, not stats.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 14:04:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369975#M162101</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-22T14:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369976#M162102</link>
      <description>&lt;P&gt;Could you please modify the same command without stats and substitute abstract&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 14:13:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369976#M162102</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-03-22T14:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369977#M162103</link>
      <description>&lt;P&gt;&lt;CODE&gt;base query | regex field= "XXX*(?.*)" | abstract maxlines=1&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 14:03:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369977#M162103</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-23T14:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369978#M162104</link>
      <description>&lt;P&gt;what will it do?&lt;BR /&gt;
it not providing the answer i expected&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 14:39:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369978#M162104</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-03-23T14:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369979#M162105</link>
      <description>&lt;P&gt;What answer are you expecting?  What exactly are you trying to do?  You insist on using &lt;CODE&gt;abstract&lt;/CODE&gt;, but perhaps that is not the way to accomplish your goal.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 12:47:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369979#M162105</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-27T12:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369980#M162106</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;actually i have regular expression..it having 5 lines value.&lt;BR /&gt;
i want one line using abstract.&lt;BR /&gt;
is it possible to do?&lt;BR /&gt;
Could you please help me in this request.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 13:05:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369980#M162106</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-03-27T13:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369981#M162107</link>
      <description>&lt;P&gt;Can you try :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base query | regex field= "XXX*(?.{10}).*\n" OR  base query | regex field= "XXX*(?[^\n\r]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Mar 2018 13:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369981#M162107</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-03-27T13:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369982#M162108</link>
      <description>&lt;P&gt;is it possible to do the same with abstract command?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 13:39:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369982#M162108</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-03-27T13:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369983#M162109</link>
      <description>&lt;P&gt;It's still not clear to me what your goal is.  You've re-stated the original request and not added any clarification.  I've done all I can do with what you've provided so far.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 13:27:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369983#M162109</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-28T13:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369984#M162110</link>
      <description>&lt;P&gt;Thanks for your help&lt;BR /&gt;
i think we can't combine abstract command and regex.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 13:32:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369984#M162110</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-03-28T13:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369985#M162111</link>
      <description>&lt;P&gt;@logloganathan, based on your description so far seems like you want your regular expression to return result only from first line of an event. The &lt;CODE&gt;.*&lt;/CODE&gt; Regular Expression by default stops at a line break which should do it. You are focused on abstract and rex command however, even if feasible that might not be right way at all. We would not be able assist you properly unless you provide further detail of what regular expression you have used and provide some mocked up anonymized data.&lt;/P&gt;

&lt;P&gt;What do you mean by &lt;CODE&gt;regular expression..it having 5 lines value&lt;/CODE&gt;? It can either be raw event with data across 5 lines or Regular Expression based extraction that fetches 5 lines instead of 1.&lt;/P&gt;

&lt;P&gt;Whether it is _raw event with 5 lines or Regular Expression fetching 5 lines, you can adjust your Regular Expression to fetch only the first line (which would be ideal way).&lt;/P&gt;

&lt;P&gt;Although I have taken an example for Splunk's _internal log which is always 1 line but you can try with your base search instead along with your own regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd
| abstract maxlines=1
| rex "^([^\s]+)\s([^\s]+)\s([^\s]+)\s(?&amp;lt;logLevel&amp;gt;[^\s]+)\s"
| table logLevel _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Mar 2018 16:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369985#M162111</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-28T16:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369986#M162112</link>
      <description>&lt;P&gt;This is one i need. Thanks for your help!!&lt;BR /&gt;
very helpful Nikenilay!! Thanks Again &lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 08:23:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369986#M162112</guid>
      <dc:creator>logloganathan</dc:creator>
      <dc:date>2018-03-29T08:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: help to build the query using abstract command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369987#M162113</link>
      <description>&lt;P&gt;@logloganathan, I am glad it worked. However, like I said, you should ideally be able to handle directly in &lt;CODE&gt;rex&lt;/CODE&gt; command without having to use &lt;CODE&gt;abstract&lt;/CODE&gt; command which is working for you but is actually just an overhead.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 09:50:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-to-build-the-query-using-abstract-command/m-p/369987#M162113</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-29T09:50:23Z</dc:date>
    </item>
  </channel>
</rss>

