<?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 Is there any way to have the below query without map command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270794#M190100</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;With the below query, am facing issue while creating dashboard, as it is having a map command.&lt;/P&gt;

&lt;P&gt;index=Test host=XXX "ABNUM" | map search="search source=$source$ | streamstats current=f last(_raw) AS next_line | search \" took \" next_line=\"&lt;EM&gt;ABNUM&lt;/EM&gt;\"" | dedup _raw next_line | rex "query took (?\d+).*((?\d+) seconds)"&lt;/P&gt;

&lt;P&gt;is there any other way to make the same without map command. &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 09:16:20 GMT</pubDate>
    <dc:creator>Abilan1</dc:creator>
    <dc:date>2020-09-29T09:16:20Z</dc:date>
    <item>
      <title>Is there any way to have the below query without map command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270794#M190100</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;With the below query, am facing issue while creating dashboard, as it is having a map command.&lt;/P&gt;

&lt;P&gt;index=Test host=XXX "ABNUM" | map search="search source=$source$ | streamstats current=f last(_raw) AS next_line | search \" took \" next_line=\"&lt;EM&gt;ABNUM&lt;/EM&gt;\"" | dedup _raw next_line | rex "query took (?\d+).*((?\d+) seconds)"&lt;/P&gt;

&lt;P&gt;is there any other way to make the same without map command. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:16:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270794#M190100</guid>
      <dc:creator>Abilan1</dc:creator>
      <dc:date>2020-09-29T09:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to have the below query without map command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270795#M190101</link>
      <description>&lt;P&gt;You could use a subsearch. Something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo [
    search index=Test host=XXX "ABNUM" | dedup source | table source
] 
| streamstats current=f last(_raw) AS next_line 
| search " took " next_line="ABNUM"
| dedup _raw next_line 
| rex "query took (?\d+).*((?\d+) seconds)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Mar 2016 07:47:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270795#M190101</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-03-31T07:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to have the below query without map command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270796#M190102</link>
      <description>&lt;P&gt;Can you add a row of two to illustrate what your raw data looks like?    I think that would help us answer your question better.   &lt;/P&gt;

&lt;P&gt;Also,  this is a bit off the cuff,  but I have a suspicion that what you need revolves around using the somewhat advanced "by" argument to streamstats. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Test host=XXX "ABNUM" | streamstats current=f last(_raw) AS next_line by source | .... 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Apr 2016 21:20:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270796#M190102</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2016-04-01T21:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to have the below query without map command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270797#M190103</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to capture the seconds which is highlighted on the below logs and only for the table ABNUM (which is on next event). &lt;/P&gt;

&lt;P&gt;Note: There are other tables like EmpID,USER,etc..will also be a part of the source file. But I need only for ABNUM table's query time. Please let me know if you need any additional information.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Log File:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Sun Mar 27 13:07:28.654666 doQueryDiagnostics: The following SQL query took &lt;STRONG&gt;4 seconds&lt;/STRONG&gt; which is equal to or greater than QueryExecutionTimeThreshold (4 seconds)&lt;/P&gt;

&lt;P&gt;Sun Mar 27 13:07:28.654975 SELECT * FROM ABNUM WHERE ( RPAN8 = 68537110.000000 )&lt;/P&gt;</description>
      <pubDate>Sat, 02 Apr 2016 21:21:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270797#M190103</guid>
      <dc:creator>Abilan1</dc:creator>
      <dc:date>2016-04-02T21:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to have the below query without map command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270798#M190104</link>
      <description>&lt;P&gt;I'm not sure if this is the problem you are facing, but you can use the "map" command in dashboards just fine... however, since dashboards use the $field$ syntax to represent any input values to the dashboard (and map commands use the same syntax to reference the value of a given input field), you need to add a second $ around any variables in your map command. So for instance, when you define your search inside your dashboard, it would be something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Test host=XXX "ABNUM" | map search="search source=$$source$$ | streamstats current=f last(_raw) AS next_line
| search \" took \" next_line=\"ABNUM\"" | dedup _raw next_line | rex "query took (?\d+).*((?\d+) seconds)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Apr 2016 17:52:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270798#M190104</guid>
      <dc:creator>techusky</dc:creator>
      <dc:date>2016-04-04T17:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to have the below query without map command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270799#M190105</link>
      <description>&lt;P&gt;It is not working on search, not sure I didn't try for dashboard. am looking for a query which works in both dashboard as well as search. &lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 15:13:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-any-way-to-have-the-below-query-without-map-command/m-p/270799#M190105</guid>
      <dc:creator>Abilan1</dc:creator>
      <dc:date>2016-04-05T15:13:57Z</dc:date>
    </item>
  </channel>
</rss>

