<?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: DB Connect 1.2.2 - Cannot connect to MSSQL - Connection Reset in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/DB-Connect-1-2-2-Cannot-connect-to-MSSQL-Connection-Reset/m-p/240224#M188806</link>
    <description>&lt;P&gt;Posting here in the hops of saving folks a lot of time and headache.&lt;/P&gt;

&lt;P&gt;First off: 1.2 DB Connect requires JVM 8 not JVM 7 as in pervious versions of DB Connect v 1.x&lt;/P&gt;

&lt;P&gt;Download the zip from Microsoft here: &lt;A href="https://www.microsoft.com/en-us/download/details.aspx?id=11774"&gt;https://www.microsoft.com/en-us/download/details.aspx?id=11774&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Un gzip and un tar it and located the sqljdbc42.jar file&lt;/P&gt;

&lt;P&gt;Put ONLY the sqljdbc42.jar into dbx/bin/lib/ folder - Make sure it's the 42.jar not 4.jar or 41.jar&lt;BR /&gt;
Also make sure splunk can access this. Typically I do a chown splunk:splunk to the file after I move it.&lt;/P&gt;

&lt;P&gt;Copy the database_types.conf from default to local and add in the following stanza: &lt;BR /&gt;
Also note that the testQuery is required, otherwise your connections will fail.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[generic_mssql]
displayName = MS-SQL Server Using MS Generic Driver
jdbcDriverClass = com.microsoft.sqlserver.jdbc.SQLServerDriver
connectionUrlFormat = jdbc:sqlserver://{0}:{1};databaseName={2};selectMethod=cursor
defaultPort = 1433
defaultCatalogName = master
testQuery = SELECT 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then update your database.conf in your local folder for each of your mssql databases:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[database_stanza]
database = database_name
host = database_host
isolation_level = DATABASE_SETTING
readonly = 1
#type = mssql
type = generic_mssql
username = Splunkservice
disabled = 0
password = [encrypted_password]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Reboot splunk&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2016 15:21:02 GMT</pubDate>
    <dc:creator>ejharts2015</dc:creator>
    <dc:date>2016-03-11T15:21:02Z</dc:date>
    <item>
      <title>DB Connect 1.2.2 - Cannot connect to MSSQL - Connection Reset</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DB-Connect-1-2-2-Cannot-connect-to-MSSQL-Connection-Reset/m-p/240223#M188805</link>
      <description>&lt;P&gt;Upgraded from DB Connect 1.0 and started getting these error messages:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-03-08 22:41:35.033 monsch1:ERROR:Scheduler - Error while reading stanza=[dbmon-dump://database_name/database_table]: com.splunk.config.SplunkConfigurationException: Error validating dbmonDump for monitor=dbmon-dump://database_name/database_table: Error getting database connection: Network error IOException: Connection reset with query =
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Mar 2016 15:14:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DB-Connect-1-2-2-Cannot-connect-to-MSSQL-Connection-Reset/m-p/240223#M188805</guid>
      <dc:creator>ejharts2015</dc:creator>
      <dc:date>2016-03-11T15:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: DB Connect 1.2.2 - Cannot connect to MSSQL - Connection Reset</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DB-Connect-1-2-2-Cannot-connect-to-MSSQL-Connection-Reset/m-p/240224#M188806</link>
      <description>&lt;P&gt;Posting here in the hops of saving folks a lot of time and headache.&lt;/P&gt;

&lt;P&gt;First off: 1.2 DB Connect requires JVM 8 not JVM 7 as in pervious versions of DB Connect v 1.x&lt;/P&gt;

&lt;P&gt;Download the zip from Microsoft here: &lt;A href="https://www.microsoft.com/en-us/download/details.aspx?id=11774"&gt;https://www.microsoft.com/en-us/download/details.aspx?id=11774&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Un gzip and un tar it and located the sqljdbc42.jar file&lt;/P&gt;

&lt;P&gt;Put ONLY the sqljdbc42.jar into dbx/bin/lib/ folder - Make sure it's the 42.jar not 4.jar or 41.jar&lt;BR /&gt;
Also make sure splunk can access this. Typically I do a chown splunk:splunk to the file after I move it.&lt;/P&gt;

&lt;P&gt;Copy the database_types.conf from default to local and add in the following stanza: &lt;BR /&gt;
Also note that the testQuery is required, otherwise your connections will fail.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[generic_mssql]
displayName = MS-SQL Server Using MS Generic Driver
jdbcDriverClass = com.microsoft.sqlserver.jdbc.SQLServerDriver
connectionUrlFormat = jdbc:sqlserver://{0}:{1};databaseName={2};selectMethod=cursor
defaultPort = 1433
defaultCatalogName = master
testQuery = SELECT 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then update your database.conf in your local folder for each of your mssql databases:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[database_stanza]
database = database_name
host = database_host
isolation_level = DATABASE_SETTING
readonly = 1
#type = mssql
type = generic_mssql
username = Splunkservice
disabled = 0
password = [encrypted_password]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Reboot splunk&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 15:21:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DB-Connect-1-2-2-Cannot-connect-to-MSSQL-Connection-Reset/m-p/240224#M188806</guid>
      <dc:creator>ejharts2015</dc:creator>
      <dc:date>2016-03-11T15:21:02Z</dc:date>
    </item>
  </channel>
</rss>

