<?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: Conversion errors with DatabaseLookupExecutor (Splunk DBX) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Conversion-errors-with-DatabaseLookupExecutor-Splunk-DBX/m-p/127640#M184372</link>
    <description>&lt;P&gt;Excellent point.  I should have been clearer.  The database I edited wasn't KACE's internal database.  The database I changed was a separate one that's populated with some of the data in KACE.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Apr 2014 15:24:58 GMT</pubDate>
    <dc:creator>megancarney</dc:creator>
    <dc:date>2014-04-11T15:24:58Z</dc:date>
    <item>
      <title>Conversion errors with DatabaseLookupExecutor (Splunk DBX)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conversion-errors-with-DatabaseLookupExecutor-Splunk-DBX/m-p/127638#M184370</link>
      <description>&lt;P&gt;Someone kindly answered my question in the Splunk channel, but I thought I'd post the answer here since it didn't show up in my searches on the site.&lt;/P&gt;

&lt;P&gt;I setup DBX to connect to a MySQL database that had a mapping between host IP addresses and the operating system on that host.&lt;/P&gt;

&lt;P&gt;When I tried to the use the lookup table I got this error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2014-04-10 11:07:35.376 dbx1929:ERROR:DatabaseLookupExecutor - Error while performing SplunkLookup DatabaseLookupExecutor: com.splunk.dbx.lookup.DBLookupException: Unsupported field SQL error while performing lookup: java.sql.SQLException: Cannot convert value "&amp;lt;redacted_host_ip&amp;gt;" to required datatype LONG com.splunk.dbx.lookup.DBLookupException: Unsupported field SQL error while performing lookup: java.sql.SQLException: Cannot convert value "&amp;lt;redacted_host_ip&amp;gt;" to required datatype LONG at com.splunk.dbx.lookup.DatabaseLookupExecutor.performSimpleLookup(DatabaseLookupExecutor.java:56) at com.splunk.dbx.lookup.DatabaseLookupExecutor.performLookup(DatabaseLookupExecutor.java:41) at com.splunk.runtime.SplunkLookup.invoke(SplunkLookup.java:26)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search was:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=proxy_logs | lookup KACE_machine_inventory host_ip OUTPUT os_name 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem was the hostip field in the database was stored as an unsigned int, and Splunk was trying to convert it to a LONG and failing.&lt;/P&gt;

&lt;P&gt;To get around this error, you need to either change the lookup to a SQL query that casts the hostip field as a varchar before bringing that data into splunk OR change the data type in the column you're using to something Splunk likes import.&lt;/P&gt;

&lt;P&gt;What I did was create a second hostip column (hostipstring) in the database that was a varchar instead of an unsigned int, and excluded the hostip column from the lookup table.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2014 18:30:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conversion-errors-with-DatabaseLookupExecutor-Splunk-DBX/m-p/127638#M184370</guid>
      <dc:creator>megancarney</dc:creator>
      <dc:date>2014-04-10T18:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion errors with DatabaseLookupExecutor (Splunk DBX)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conversion-errors-with-DatabaseLookupExecutor-Splunk-DBX/m-p/127639#M184371</link>
      <description>&lt;P&gt;hi, another way to do this is to use the SQL command CONVERT... e.g. &lt;CODE&gt;SELECT CONVERT(varchar(10), host_ip),os_name FROM table_name&lt;/CODE&gt;. That way you're not messing with the schema in KACE's database, which can lead to performance or upgrade problems.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:21:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conversion-errors-with-DatabaseLookupExecutor-Splunk-DBX/m-p/127639#M184371</guid>
      <dc:creator>jcoates_splunk</dc:creator>
      <dc:date>2020-09-28T16:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion errors with DatabaseLookupExecutor (Splunk DBX)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conversion-errors-with-DatabaseLookupExecutor-Splunk-DBX/m-p/127640#M184372</link>
      <description>&lt;P&gt;Excellent point.  I should have been clearer.  The database I edited wasn't KACE's internal database.  The database I changed was a separate one that's populated with some of the data in KACE.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2014 15:24:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conversion-errors-with-DatabaseLookupExecutor-Splunk-DBX/m-p/127640#M184372</guid>
      <dc:creator>megancarney</dc:creator>
      <dc:date>2014-04-11T15:24:58Z</dc:date>
    </item>
  </channel>
</rss>

