<?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: query MySQL from Splunk on Linux 64bit in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90428#M1289</link>
    <description>&lt;P&gt;You my consider instead using the &lt;A href="http://code.google.com/p/pymysql/"&gt;pymsql&lt;/A&gt; python module. It's pure Python, so all you need to do is stick it in the bin directory of your app under your python script, e.g. put it in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/myapplication/bin/pymysql/&lt;/CODE&gt; and this script in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/myapplication/bin/testconnection.py&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import traceback
import pymysql
try:
    cn = pymsql.connect(host="mydbserver",port=3306,user="root",password="whatever",db="mydatabase")
    csr = cn.cursor()
    csr.execute("SELECT 1+1 FROM DUAL")

    for r in csr:
        print r
except Exception as e:
    print e
    traceback.print_exc()
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Apr 2011 22:01:45 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2011-04-27T22:01:45Z</dc:date>
    <item>
      <title>query MySQL from Splunk on Linux 64bit</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90427#M1288</link>
      <description>&lt;P&gt;This is a repeat of  &lt;A href="http://splunk-base.splunk.com/answers/8001/howto-query-mysql-from-splunk-on-linux-64bit"&gt;HOWTO: query MySQL from Splunk on Linux 64bit&lt;/A&gt;, but that solution did not work for me. Running an Intel processor, but tried the solution with both x86 and AMD64 packages.&lt;BR /&gt;
Unlike the previous post, I do have root access.&lt;BR /&gt;
Running Splunk 4.2 on RHEL 5.5. 64bit&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2011 21:02:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90427#M1288</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-04-27T21:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: query MySQL from Splunk on Linux 64bit</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90428#M1289</link>
      <description>&lt;P&gt;You my consider instead using the &lt;A href="http://code.google.com/p/pymysql/"&gt;pymsql&lt;/A&gt; python module. It's pure Python, so all you need to do is stick it in the bin directory of your app under your python script, e.g. put it in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/myapplication/bin/pymysql/&lt;/CODE&gt; and this script in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/myapplication/bin/testconnection.py&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import traceback
import pymysql
try:
    cn = pymsql.connect(host="mydbserver",port=3306,user="root",password="whatever",db="mydatabase")
    csr = cn.cursor()
    csr.execute("SELECT 1+1 FROM DUAL")

    for r in csr:
        print r
except Exception as e:
    print e
    traceback.print_exc()
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Apr 2011 22:01:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90428#M1289</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-04-27T22:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: query MySQL from Splunk on Linux 64bit</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90429#M1290</link>
      <description>&lt;P&gt;There might be some squirrellyness between Python versions on the &lt;CODE&gt;except&lt;/CODE&gt; clause. I guess you could drop the whole &lt;CODE&gt;try&lt;/CODE&gt;...&lt;CODE&gt;except&lt;/CODE&gt; part for testing purposes.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2011 22:03:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90429#M1290</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-04-27T22:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: query MySQL from Splunk on Linux 64bit</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90430#M1291</link>
      <description>&lt;P&gt;it just needs to be in the python search path. the first entry in the python search path is usually the directory in which the calling script is located.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2011 23:13:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90430#M1291</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-04-27T23:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: query MySQL from Splunk on Linux 64bit</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90431#M1292</link>
      <description>&lt;P&gt;Any installation necessary, or just put the egg file in the directory?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2011 23:19:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90431#M1292</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-04-27T23:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: query MySQL from Splunk on Linux 64bit</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90432#M1293</link>
      <description>&lt;P&gt;i wouldn't use an egg file or try to install it or anything. i would just drop the source pymysql directory right into the bin folder. It's pure Python, so that should be all you need.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2011 23:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90432#M1293</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-04-27T23:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: query MySQL from Splunk on Linux 64bit</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90433#M1294</link>
      <description>&lt;P&gt;Create a scripted input. The script starts by checking the primary key values of my db table and compares it to the previously recorded value from the last time the script was run. If the database maximum primary key is higher than the old value I know there are new records that need to be added to splunk. Next, the script queries for all records where the max id &amp;gt; old max id. Output your fields and format them the way you want which you'll have to reference in transforms.conf. The last part of the script records the new max id value to be used the next time the script runs. Lastly, in Splunk Web create a scripted input and run it every few minutes, every hour...whatever interval you want.&lt;/P&gt;

&lt;P&gt;Another option you might try is MySQL Connector It works for me in Splunk 4.3.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2012 23:06:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90433#M1294</guid>
      <dc:creator>jpass</dc:creator>
      <dc:date>2012-08-24T23:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: query MySQL from Splunk on Linux 64bit</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90434#M1295</link>
      <description>&lt;P&gt;If you can upgrade Splunk to 4.3, the DB Connect app will allow you to do this &amp;amp; it's really easy to use.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2013 15:36:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-MySQL-from-Splunk-on-Linux-64bit/m-p/90434#M1295</guid>
      <dc:creator>jpass</dc:creator>
      <dc:date>2013-01-30T15:36:37Z</dc:date>
    </item>
  </channel>
</rss>

