<?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: Preventing format from being called on a subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24316#M4439</link>
    <description>&lt;P&gt;That's odd on the stats, provided you have no search in front of it the stats just has to go "Oh - no events, print out count=0 and be done!" in no time at all.&lt;/P&gt;</description>
    <pubDate>Mon, 06 May 2013 14:33:59 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2013-05-06T14:33:59Z</dc:date>
    <item>
      <title>Preventing format from being called on a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24311#M4434</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a macro (a subsearch enclosed in square brackets) that I use to filter my initial search.  I would like to do some regex magic on the search string that format creates.  Unfortunately, if I call format and do parsing on the search field, a second format seems to be implicitly called at the end of the macro, and it encloses the regexed search string in an extra set of quotes and double parentheses, which confuses the outer search.  Is there a way either to prevent format from being called at all, or to keep it from enclosing the field in quotes?&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2013 20:40:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24311#M4434</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2013-05-03T20:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Preventing format from being called on a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24312#M4435</link>
      <description>&lt;P&gt;When I do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[gentimes start=-1 increment=8h | fields starthuman | format | eval search = replace(search, "\(", "{") | eval search = replace(search, "\)", "}")]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;there is no extra format being called, and splunk's litsearch literally does look for curly braces - what are you doing differently?&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2013 21:11:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24312#M4435</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-05-03T21:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Preventing format from being called on a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24313#M4436</link>
      <description>&lt;P&gt;I'm playing with parsing input from a dashboard textbox.  It's something like this.  &lt;/P&gt;

&lt;P&gt;[dummy search| head 1 | eval foo="$input$" | rex field=foo "(?&lt;FIELD1&gt;stuff)(?&lt;FIELD2&gt;morestuff)" | table field1, field2 | format | rex field=search mode=sed "regexery"]&lt;/FIELD2&gt;&lt;/FIELD1&gt;&lt;/P&gt;

&lt;P&gt;If I run it in the search bar without the brackets and paste the resulting query in my outer search, it works fine.  When I call it as a macro, it doesn't.  If I run it in the search bar with the square brackets included, it adds an extra ((" and ")) on either side of the string, which I'm guessing is how the search sees it.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2013 21:28:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24313#M4436</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2013-05-03T21:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Preventing format from being called on a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24314#M4437</link>
      <description>&lt;P&gt;Hmm. Two thoughts - first, you can replace &lt;CODE&gt;dummy search | head 1&lt;/CODE&gt; with &lt;CODE&gt;stats count&lt;/CODE&gt; to use up zero resources whatsoever and second, have you considered using eval-based macros instead of the subsearch?&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2013 21:37:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24314#M4437</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-05-03T21:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Preventing format from being called on a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24315#M4438</link>
      <description>&lt;P&gt;stats count actually takes several seconds to return a single event.  I can't write the macro as a single eval statement because of the regex requirements, and I have never gotten eval-based macros to work in a more complicated format.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2013 14:22:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24315#M4438</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2013-05-06T14:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Preventing format from being called on a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24316#M4439</link>
      <description>&lt;P&gt;That's odd on the stats, provided you have no search in front of it the stats just has to go "Oh - no events, print out count=0 and be done!" in no time at all.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2013 14:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24316#M4439</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-05-06T14:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Preventing format from being called on a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24317#M4440</link>
      <description>&lt;P&gt;Actually, if I use index=null splunk_server=localhost | stats count, that returns relatively quickly--it's the going out to the distributed search peers that makes it take forever.  But at any rate, getting the returned macro string correct is my bigger concern.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2013 14:40:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24317#M4440</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2013-05-06T14:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Preventing format from being called on a subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24318#M4441</link>
      <description>&lt;P&gt;Figured it out.  I can just call return at the end of the macro and it doesn't reapply the formatting.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2013 13:48:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Preventing-format-from-being-called-on-a-subsearch/m-p/24318#M4441</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2013-05-07T13:48:12Z</dc:date>
    </item>
  </channel>
</rss>

