<?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: Do splunk commands send output to stdout? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Do-splunk-commands-send-output-to-stdout/m-p/494576#M194529</link>
    <description>&lt;P&gt;Greetings @tsheets13,&lt;/P&gt;

&lt;P&gt;At least on Windows, it does. I also know (Windows only, unsure of *nix, but can't imagine it's different) that simply outputting text is read by scripted batch files.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;splunk status 1&amp;gt; d:\status.txt&lt;/CODE&gt; works.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Jacob&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2019 19:00:05 GMT</pubDate>
    <dc:creator>jacobpevans</dc:creator>
    <dc:date>2019-10-09T19:00:05Z</dc:date>
    <item>
      <title>Do splunk commands send output to stdout?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Do-splunk-commands-send-output-to-stdout/m-p/494575#M194528</link>
      <description>&lt;P&gt;When you run ‘splunk status’ or ‘splunk start’ etc., is the output sent to stdout?  I’m working with an automations script, and while commands like ‘ls -la’ return the resulting text, for some reason, splunk commands do not.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 18:48:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Do-splunk-commands-send-output-to-stdout/m-p/494575#M194528</guid>
      <dc:creator>tsheets13</dc:creator>
      <dc:date>2019-10-09T18:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Do splunk commands send output to stdout?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Do-splunk-commands-send-output-to-stdout/m-p/494576#M194529</link>
      <description>&lt;P&gt;Greetings @tsheets13,&lt;/P&gt;

&lt;P&gt;At least on Windows, it does. I also know (Windows only, unsure of *nix, but can't imagine it's different) that simply outputting text is read by scripted batch files.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;splunk status 1&amp;gt; d:\status.txt&lt;/CODE&gt; works.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Jacob&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 19:00:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Do-splunk-commands-send-output-to-stdout/m-p/494576#M194529</guid>
      <dc:creator>jacobpevans</dc:creator>
      <dc:date>2019-10-09T19:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Do splunk commands send output to stdout?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Do-splunk-commands-send-output-to-stdout/m-p/494577#M194530</link>
      <description>&lt;P&gt;Hi tsheets13,&lt;/P&gt;

&lt;P&gt;Yes, the &lt;CODE&gt;splunk&lt;/CODE&gt; command sends output to stdout. You can try this for the &lt;CODE&gt;status&lt;/CODE&gt; option:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@crux:~$ /opt/splunk/bin/splunk status 1&amp;gt; /tmp/foo
splunk@crux:~$ cat !$
cat /tmp/foo
splunkd is running (PID: 2431).
splunk helpers are running (PIDs: 2432 2621 4649 4682).
splunk@crux:~$ 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But i found that the &lt;CODE&gt;restart&lt;/CODE&gt; option works best when using &lt;CODE&gt;| tee&lt;/CODE&gt; instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@crux:/opt/splunk/var/log/splunk$ /opt/splunk/bin/splunk restart | tee /tmp/foo
Stopping splunkd...
Shutting down.  Please wait, as this may take a few minutes.
.....................................
Stopping splunk helpers...

Done.

Splunk&amp;gt; Like an F-18, bro.

All preliminary checks passed.

Starting splunk server daemon (splunkd)...  
Done


Waiting for web server at &lt;A href="https://127.0.0.1:8000" target="test_blank"&gt;https://127.0.0.1:8000&lt;/A&gt; to be available........... Done


If you get stuck, we're here to help.  
Look for answers here: &lt;A href="http://docs.splunk.com" target="test_blank"&gt;http://docs.splunk.com&lt;/A&gt;

The Splunk web interface is at &lt;A href="https://crux:8000" target="test_blank"&gt;https://crux:8000&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and the output looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@crux:/opt/splunk/var/log/splunk$ cat !$
cat /tmp/foo
Stopping splunkd...
Shutting down.  Please wait, as this may take a few minutes.
.....................................
Stopping splunk helpers...

Done.

Splunk&amp;gt; Like an F-18, bro.

All preliminary checks passed.

Starting splunk server daemon (splunkd)...  
Done


Waiting for web server at &lt;A href="https://127.0.0.1:8000" target="test_blank"&gt;https://127.0.0.1:8000&lt;/A&gt; to be available........... Done


If you get stuck, we're here to help.  
Look for answers here: &lt;A href="http://docs.splunk.com" target="test_blank"&gt;http://docs.splunk.com&lt;/A&gt;

The Splunk web interface is at &lt;A href="https://crux:8000" target="test_blank"&gt;https://crux:8000&lt;/A&gt;

splunk@crux:/opt/splunk/var/log/splunk$ 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 19:22:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Do-splunk-commands-send-output-to-stdout/m-p/494577#M194530</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-10-09T19:22:54Z</dc:date>
    </item>
  </channel>
</rss>

