<?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 How to &amp;quot;pipe&amp;quot; output to another search command from the Splunk CLI in Windows? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66313#M180422</link>
    <description>&lt;P&gt;I'm trying to execute some queries from the Command Line on a Windows Splunk server.  As long as I don't use the "pipe" symbol to perform additional filters, the results come back fine.  If I tried to "pipe" the results to the "head" command, for example, in the following query:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;E:\Apps\Splunk\bin&amp;gt;splunk search 'sourcetype=syslog | head 5 | table host index _time'&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Windows would return the following error:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;'head' is not recognized as an
  internal or external command, operable
  program or batch file.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This error occurs for all command I want to pipe the results to, not just the "head" command.  The same command line query works perfectly in the Linux version of Splunk.&lt;/P&gt;

&lt;P&gt;The CLI examples given in the documenataion and from the "splunk help search" command does not reference piping results to additional commands.  Does anyone know the proper way to format a CLI query with pipes in the Windows version of Splunk?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Oct 2010 22:43:56 GMT</pubDate>
    <dc:creator>williamche</dc:creator>
    <dc:date>2010-10-07T22:43:56Z</dc:date>
    <item>
      <title>How to "pipe" output to another search command from the Splunk CLI in Windows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66313#M180422</link>
      <description>&lt;P&gt;I'm trying to execute some queries from the Command Line on a Windows Splunk server.  As long as I don't use the "pipe" symbol to perform additional filters, the results come back fine.  If I tried to "pipe" the results to the "head" command, for example, in the following query:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;E:\Apps\Splunk\bin&amp;gt;splunk search 'sourcetype=syslog | head 5 | table host index _time'&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Windows would return the following error:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;'head' is not recognized as an
  internal or external command, operable
  program or batch file.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This error occurs for all command I want to pipe the results to, not just the "head" command.  The same command line query works perfectly in the Linux version of Splunk.&lt;/P&gt;

&lt;P&gt;The CLI examples given in the documenataion and from the "splunk help search" command does not reference piping results to additional commands.  Does anyone know the proper way to format a CLI query with pipes in the Windows version of Splunk?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2010 22:43:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66313#M180422</guid>
      <dc:creator>williamche</dc:creator>
      <dc:date>2010-10-07T22:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to "pipe" output to another search command from the Splunk CLI in Windows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66314#M180423</link>
      <description>&lt;P&gt;I feel like cheating by answering my own question, but the proper way to format a CLI query in Windows Splunk is to wrap the query in double-quotes.&lt;/P&gt;

&lt;P&gt;So instead of:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;E:\Apps\Splunk\bin&amp;gt;splunk search
  'sourcetype=syslog | head 5 | table
  host index _time'&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;It should be:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;E:\Apps\Splunk\bin&amp;gt;splunk search
  "sourcetype=syslog | head 5 | table
  host index _time"&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;In Linux its still single quotes.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2010 22:45:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66314#M180423</guid>
      <dc:creator>williamche</dc:creator>
      <dc:date>2010-10-07T22:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to "pipe" output to another search command from the Splunk CLI in Windows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66315#M180424</link>
      <description>&lt;P&gt;Just wanted to point out that the question is less to do with Linux vs Windows, and more to do with BASH (or whatever shell you're using) vs the windows shell (cmd.exe).  For example, on Linux you could to use a different shell and it could behave differently; but I would expect that most shell should work fine with single quotes or double quotes.  On Windows you have less choices out of the box, but you can install and use bash (with cygwin, or something similar) if you wanted to.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2010 00:51:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66315#M180424</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-10-08T00:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to "pipe" output to another search command from the Splunk CLI in Windows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66316#M180425</link>
      <description>&lt;P&gt;BTW, It's perfectly acceptable to answer your own question, but you may have to wait a few days before you can "accept" your own answer.  Which you should do.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2010 00:53:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66316#M180425</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-10-08T00:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to "pipe" output to another search command from the Splunk CLI in Windows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66317#M180426</link>
      <description>&lt;P&gt;I know this is old, but I thought I'd add that in Powershell, you still use the single quote, not double.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2013 16:49:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-quot-pipe-quot-output-to-another-search-command-from-the/m-p/66317#M180426</guid>
      <dc:creator>jevenson</dc:creator>
      <dc:date>2013-01-08T16:49:01Z</dc:date>
    </item>
  </channel>
</rss>

