<?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: Collecting data via a python script, later putting it into Splunk in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-data-via-a-python-script-later-putting-it-into-Splunk/m-p/149276#M30412</link>
    <description>&lt;P&gt;Thanks, that is helpful.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;it is your script so do the directory&lt;BR /&gt;
structure like you prefer. Provide the&lt;BR /&gt;
content as JSON or CSV or Key=Value&lt;BR /&gt;
pairs - Splunk can handle those&lt;BR /&gt;
without trouble.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Since I have three different types of information (netstat, sync-gateway, top), how can I "tag" these files such that they show up in splunk in such a way that I can say things like "show me all the netstat readings, but ignore the other stuff"?&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jun 2015 16:59:13 GMT</pubDate>
    <dc:creator>tleyden</dc:creator>
    <dc:date>2015-06-12T16:59:13Z</dc:date>
    <item>
      <title>Collecting data via a python script, later putting it into Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-data-via-a-python-script-later-putting-it-into-Splunk/m-p/149274#M30410</link>
      <description>&lt;P&gt;We have some customers which are running into memory issues, and we need to provide them a script to collect several pieces of data:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Netstats for a particular pid (sudo netstat -apeen | grep -i app_name)&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Application server stats which are available at our application server's REST endpoint which returns JSON&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Overall memory stats (eg, top output) for a particular pid&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;and probably a few others.&lt;/P&gt;

&lt;P&gt;It feels like a perfect job for Splunk!  But .. it also feels a bit heavyweight to tell customers to install and configure a splunk forwarder.  So I'm planning to take a "middle ground" approach:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Ship them a python script that they would run, and which will have little or no 3rd party dependencies (single script, possibly even bundled as an exe)&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;The python script will collect outputs mentioned above and put them in a directory structure&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;The customer can then run the script to collect data, and then zip up the directory, and ship that back to us&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;We somehow get the data into our own Splunk server to analyze it.  (unzip, load somehow)&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Here are my questions:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;For #2 above, what is the best directory/file structure to use?  Something like this?&lt;/P&gt;

&lt;P&gt;/netstat/&lt;BR /&gt;
      timestamp1.txt  (contains raw netstat output, anything else needed?)&lt;BR /&gt;
      timestamp2.txt&lt;BR /&gt;&lt;BR /&gt;
   /sync-gateway&lt;BR /&gt;
      timestamp1.txt (contains raw JSON, ditto)&lt;BR /&gt;
      timestamp2.txt&lt;BR /&gt;
   /top&lt;BR /&gt;
      timestamp1.txt (contains raw top output, ditto)&lt;BR /&gt;
      timestamp2.txt &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;For #4 above, what's the easiest way to get this data into splunk?&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Also, any general guidelines on the approach would be very helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2015 00:10:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-data-via-a-python-script-later-putting-it-into-Splunk/m-p/149274#M30410</guid>
      <dc:creator>tleyden</dc:creator>
      <dc:date>2015-06-12T00:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting data via a python script, later putting it into Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-data-via-a-python-script-later-putting-it-into-Splunk/m-p/149275#M30411</link>
      <description>&lt;P&gt;Hi tleyden,&lt;/P&gt;

&lt;P&gt;basically there is nothing to recommend for #2, it is your script so do the directory structure like you prefer. Provide the content as JSON or CSV or Key=Value pairs - Splunk can handle those without trouble.&lt;/P&gt;

&lt;P&gt;Regarding #4:&lt;BR /&gt;
Setup an monitor in &lt;CODE&gt;inputs.conf&lt;/CODE&gt; for some directory (&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Configureyourinputs"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Configureyourinputs&lt;/A&gt;) and put the zips inside of the directory. Splunk will unpack them and index the data.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2015 01:25:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-data-via-a-python-script-later-putting-it-into-Splunk/m-p/149275#M30411</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-06-12T01:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting data via a python script, later putting it into Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-data-via-a-python-script-later-putting-it-into-Splunk/m-p/149276#M30412</link>
      <description>&lt;P&gt;Thanks, that is helpful.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;it is your script so do the directory&lt;BR /&gt;
structure like you prefer. Provide the&lt;BR /&gt;
content as JSON or CSV or Key=Value&lt;BR /&gt;
pairs - Splunk can handle those&lt;BR /&gt;
without trouble.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Since I have three different types of information (netstat, sync-gateway, top), how can I "tag" these files such that they show up in splunk in such a way that I can say things like "show me all the netstat readings, but ignore the other stuff"?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2015 16:59:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-data-via-a-python-script-later-putting-it-into-Splunk/m-p/149276#M30412</guid>
      <dc:creator>tleyden</dc:creator>
      <dc:date>2015-06-12T16:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting data via a python script, later putting it into Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Collecting-data-via-a-python-script-later-putting-it-into-Splunk/m-p/149277#M30413</link>
      <description>&lt;P&gt;almighty docs can help &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Knowledge/Abouttagsandaliases"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.3/Knowledge/Abouttagsandaliases&lt;/A&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jun 2015 04:34:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Collecting-data-via-a-python-script-later-putting-it-into-Splunk/m-p/149277#M30413</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-06-13T04:34:41Z</dc:date>
    </item>
  </channel>
</rss>

