<?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: Change output location of splunk diag? in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14284#M6737</link>
    <description>&lt;P&gt;Good idea.  I'll file a feature request.&lt;/P&gt;</description>
    <pubDate>Thu, 27 May 2010 02:57:15 GMT</pubDate>
    <dc:creator>smisplunk</dc:creator>
    <dc:date>2010-05-27T02:57:15Z</dc:date>
    <item>
      <title>Change output location of splunk diag?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14282#M6735</link>
      <description>&lt;P&gt;I've seen from personal experience, as well as the answer at &lt;A href="http://answers.splunk.com/questions/167/how-do-i-generate-a-diag-splunk-diagnostics-file" rel="nofollow"&gt;http://answers.splunk.com/questions/167/how-do-i-generate-a-diag-splunk-diagnostics-file&lt;/A&gt; that the output from a &lt;CODE&gt;splunk diag&lt;/CODE&gt; command goes to $SPLUNK_HOME.  One of our users requests that it be placed in &lt;CODE&gt;/var&lt;/CODE&gt;.  Is this possible?&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2010 08:12:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14282#M6735</guid>
      <dc:creator>smisplunk</dc:creator>
      <dc:date>2010-05-26T08:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change output location of splunk diag?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14283#M6736</link>
      <description>&lt;P&gt;It does not appear that specifying an output location is a supported feature in the current release.  If your issues is disk space, you should also be aware that a temporary copy of all the files that are being archived are also kept under your &lt;CODE&gt;$SPLUNK_HOME&lt;/CODE&gt; location as well.  (The temporary folder is  &lt;CODE&gt;$SPLUNK_HOME/var/run/splunk/diag-temp&lt;/CODE&gt;)&lt;/P&gt;

&lt;P&gt;Your can review the &lt;CODE&gt;splunk diag&lt;/CODE&gt; actions in the following script:
   &lt;CODE&gt;$SPLUNK_HOME/lib/python2.6/site-packages/splunk/clilib/info_gather.py&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Note:  This is the unix install path, it may be slightly different on Windows or older version of splunk&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I took a quick look.  If you really want, you could override the &lt;CODE&gt;get_tar_name()&lt;/CODE&gt; function to return a different path, but making modifications definitely falls into the "at-your-own-risk" category.  Each upgrade would overwrite any customizations.&lt;/P&gt;

&lt;P&gt;If this is something that you need long term, I would suggest sending a feature request to splunk support.  It doesn't seem like it should be all that difficult to implement.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2010 20:16:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14283#M6736</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-26T20:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Change output location of splunk diag?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14284#M6737</link>
      <description>&lt;P&gt;Good idea.  I'll file a feature request.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2010 02:57:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14284#M6737</guid>
      <dc:creator>smisplunk</dc:creator>
      <dc:date>2010-05-27T02:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change output location of splunk diag?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14285#M6738</link>
      <description>&lt;P&gt;Splunk 6 allows you to grab a diag file remotely.  This saved me today as I was writing a diag with debug information that was too large for the remaining space in /opt/splunk/ on the server.&lt;/P&gt;

&lt;PRE&gt;
bin/splunk/diag -uri &lt;A href="https://splunk-server:mgmt-port" target="test_blank"&gt;https://splunk-server:mgmt-port&lt;/A&gt;
&lt;/PRE&gt;

&lt;P&gt;brings the diag file to your current server.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 18:50:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14285#M6738</guid>
      <dc:creator>wbfoxii</dc:creator>
      <dc:date>2014-04-25T18:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Change output location of splunk diag?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14286#M6739</link>
      <description>&lt;P&gt;It's probably worth mentioning since it was difficult to find. There is an option to write the diag to stdout as an uncompressed tar. From there you can do what you like. This is useful if you don't have space on the remote server.&lt;/P&gt;

&lt;P&gt;this will send the diag as uncmpressed tar to stdout, then pass that through gzip prior to passing the gzipped output back through your ssh session and redirecting to a local gzipped copy. Note, the pipe needs to be escaped if you want to gzip prior to data transferring across the network.&lt;BR /&gt;
ssh user@remoteserver $SPLUNK_HOME/bin/splunk diag --stdout | gzip &amp;gt; mydiag.tgz&lt;/P&gt;

&lt;P&gt;If you just want to put the file into /tmp or /var then you can do this...&lt;BR /&gt;
$SPLUNK_HOME/splunk diag --stdout | gzip &amp;gt; /tmp/mydiag.tgz&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 20:58:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/14286#M6739</guid>
      <dc:creator>lumpymilk</dc:creator>
      <dc:date>2018-08-24T20:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Change output location of splunk diag?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/672591#M9939</link>
      <description>&lt;P&gt;I use a workaround. Background of what I did: I am writing a bash script, to create Splunk diag using splunk user and move the diag file to the desired folder of mine.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;[root@myserver ~]# vi test_script.sh&lt;BR /&gt;sudo -i -u splunk bash &amp;lt;&amp;lt; EOF&lt;BR /&gt;# Create Splunk Diagnostic Report&lt;BR /&gt;/opt/splunk/bin/splunk diag &amp;gt; /opt/splunk/mylog.log&lt;BR /&gt;EOF&lt;/P&gt;&lt;P&gt;# Use grep to extract the path from the output&lt;BR /&gt;diag_path=$(cat /opt/splunk/mylog.log | grep -oP '(?&amp;lt;=Splunk diagnosis file created: )/.*\.tar\.gz')&lt;BR /&gt;echo $diag_path&lt;/P&gt;&lt;P&gt;# Check if the path is not empty&lt;BR /&gt;if [ -n "$diag_path" ]; then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# Copy the file to /root/mydesiredfolder&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;mv "$diag_path" /root/mydesiredfolder&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;echo "File copied successfully to /root/mydesiredfolder"&lt;BR /&gt;else&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;echo "Path not found or command did not generate the expected output"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;# Cleanup&lt;BR /&gt;rm&amp;nbsp;/opt/splunk/mylog.log&lt;BR /&gt;&lt;BR /&gt;##########&lt;BR /&gt;The idea behind it is when running ./splunk diag, it will have the output of something like this&lt;BR /&gt;Splunk diagnosis file created: /opt/splunk/diag-servername-2023-12-22_08-19-01.tar.gz&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 08:42:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Change-output-location-of-splunk-diag/m-p/672591#M9939</guid>
      <dc:creator>JL99</dc:creator>
      <dc:date>2023-12-22T08:42:16Z</dc:date>
    </item>
  </channel>
</rss>

