<?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: How to use the Format search command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43583#M10246</link>
    <description>&lt;P&gt;Try like this :&lt;/P&gt;

&lt;P&gt;index=* | stats values(sourcetype) as sourcetype by host | join [search index=* | stats values(source) as source by host]&lt;/P&gt;</description>
    <pubDate>Tue, 20 May 2014 22:55:27 GMT</pubDate>
    <dc:creator>splunker12er</dc:creator>
    <dc:date>2014-05-20T22:55:27Z</dc:date>
    <item>
      <title>How to use the Format search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43579#M10242</link>
      <description>&lt;P&gt;How to use the "Format" search commands using the optinal arguments....&lt;/P&gt;

&lt;P&gt;The documentation does not show how to use the optional arguments for this command.&lt;/P&gt;

&lt;P&gt;searchsourcetype="tvs-a9-request" |stats dc(TextQuery) as Query|append [search  sourcetype="tvs-a9-request" |stats count(MAC) as Number]| format&lt;/P&gt;

&lt;P&gt;Result set:&lt;BR /&gt;
( ( Query="3818" ) OR ( Number="9184" ) )&lt;/P&gt;

&lt;P&gt;I would like to format this result set as  follow:&lt;/P&gt;

&lt;P&gt;query   Number&lt;BR /&gt;
3818   9184&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2011 12:08:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43579#M10242</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2011-07-15T12:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Format search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43580#M10243</link>
      <description>&lt;P&gt;It actually does explain the arguments, which are 6 separate strings:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Optional arguments

&amp;lt;string&amp;gt;
  Syntax: "&amp;lt;string&amp;gt;"
  Description: These six optional string arguments correspond to: ["&amp;lt;row prefix&amp;gt;" "&amp;lt;column prefix&amp;gt;" "&amp;lt;column separator&amp;gt;" "&amp;lt;column end&amp;gt;" "&amp;lt;row separator&amp;gt;" "&amp;lt;row end&amp;gt;"]. By default, when you don't specify any strings, the format output defaults to: "(" "(" "AND" ")" "OR" ")"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The format command is really used in the creation of a search, which is why it will join all rows and columns to create a valid search string.  Is that what you're doing here, or are you just looking to get a string to output on a dashboard?  If it's the latter, something like this would probably work better.  I don't see any reason to use that append subsearch either:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;searchsourcetype="tvs-a9-request" 
  | stats dc(TextQuery) as Query count(MAC) as Number 
  | strcat "Query Number " Query " " Number my_new_string 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Jul 2011 20:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43580#M10243</guid>
      <dc:creator>mw</dc:creator>
      <dc:date>2011-07-15T20:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Format search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43581#M10244</link>
      <description>&lt;P&gt;Thanks for your reply. In this case, your query is great we do not need append or appendcols commands. I think I was not clear in my previous post. I have two similar queries:&lt;/P&gt;

&lt;P&gt;query 1:&lt;BR /&gt;
sourcetype="tvs-a9-request" NOT forward |stats dc(TextQuery) as Query1&lt;/P&gt;

&lt;P&gt;query 2:&lt;BR /&gt;
sourcetype="tvs-a9-request" AND forward |stats dc(TextQuery) as Query2&lt;/P&gt;

&lt;P&gt;how can I get in one query both results set preseted in a table without using append or appendcols commands: example&lt;/P&gt;

&lt;P&gt;Query 1   Query 2&lt;BR /&gt;
125        254&lt;/P&gt;

&lt;P&gt;thanks,&lt;BR /&gt;
Lp&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2011 13:59:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43581#M10244</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2011-07-18T13:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Format search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43582#M10245</link>
      <description>&lt;P&gt;Thanks for your reply. In this case, your query is great we do not need append or appendcols commands. I think, I was not clear in my previous post. I have two similar queries:&lt;/P&gt;

&lt;P&gt;query 1: sourcetype="tvs-a9-request" NOT forward |stats dc(TextQuery) as Query1&lt;/P&gt;

&lt;P&gt;query 2: sourcetype="tvs-a9-request" AND forward |stats dc(TextQuery) as Query2&lt;/P&gt;

&lt;P&gt;How can I get in one query both results sets preseted in a table without using append or appendcols commands: example&lt;/P&gt;

&lt;P&gt;Query 1 Query 2 &lt;BR /&gt;
125     254&lt;/P&gt;

&lt;P&gt;thanks,&lt;BR /&gt;
 Lp&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2011 14:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43582#M10245</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2011-07-18T14:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Format search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43583#M10246</link>
      <description>&lt;P&gt;Try like this :&lt;/P&gt;

&lt;P&gt;index=* | stats values(sourcetype) as sourcetype by host | join [search index=* | stats values(source) as source by host]&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2014 22:55:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43583#M10246</guid>
      <dc:creator>splunker12er</dc:creator>
      <dc:date>2014-05-20T22:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Format search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43584#M10247</link>
      <description>&lt;P&gt;Use transpose to do that.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
searchsourcetype="tvs-a9-request" |stats dc(TextQuery) as Query|append [search sourcetype="tvs-a9-request" |stats count(MAC) as Number]| transpose&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2014 23:14:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-the-Format-search-command/m-p/43584#M10247</guid>
      <dc:creator>Lamar</dc:creator>
      <dc:date>2014-05-20T23:14:15Z</dc:date>
    </item>
  </channel>
</rss>

