<?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 How to update database table rows with Splunk data? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-update-database-table-rows-with-Splunk-data/m-p/384238#M46751</link>
    <description>&lt;P&gt;I want to update a database table with data from Splunk. I need to join on an ID field. So if my data has a row with ID = A and the database table has a row with ID = A, that row should be updated with my new data. If my row has an ID that isn't already in the database table, add the new row. &lt;/P&gt;

&lt;P&gt;I've tried dbxoutput, but that seems to only append all the new data without joining on any field. How have others achieved this?&lt;/P&gt;</description>
    <pubDate>Mon, 07 May 2018 20:05:55 GMT</pubDate>
    <dc:creator>matstap</dc:creator>
    <dc:date>2018-05-07T20:05:55Z</dc:date>
    <item>
      <title>How to update database table rows with Splunk data?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-update-database-table-rows-with-Splunk-data/m-p/384238#M46751</link>
      <description>&lt;P&gt;I want to update a database table with data from Splunk. I need to join on an ID field. So if my data has a row with ID = A and the database table has a row with ID = A, that row should be updated with my new data. If my row has an ID that isn't already in the database table, add the new row. &lt;/P&gt;

&lt;P&gt;I've tried dbxoutput, but that seems to only append all the new data without joining on any field. How have others achieved this?&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 20:05:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-update-database-table-rows-with-Splunk-data/m-p/384238#M46751</guid>
      <dc:creator>matstap</dc:creator>
      <dc:date>2018-05-07T20:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to update database table rows with Splunk data?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-update-database-table-rows-with-Splunk-data/m-p/384239#M46752</link>
      <description>&lt;P&gt;You can have dbxquery to call store procedure to achieve.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/DBX/3.1.3/DeployDBX/Commands#Required_Arguments"&gt;http://docs.splunk.com/Documentation/DBX/3.1.3/DeployDBX/Commands#Required_Arguments&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 23:33:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-update-database-table-rows-with-Splunk-data/m-p/384239#M46752</guid>
      <dc:creator>mchang_splunk</dc:creator>
      <dc:date>2018-05-08T23:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to update database table rows with Splunk data?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-update-database-table-rows-with-Splunk-data/m-p/384240#M46753</link>
      <description>&lt;P&gt;If you want to upsert functionality in a database, "Enable Upsert" should be checked with a proper column name(in your case - ID column) under "Upsert Configuration" section in the 3rd step(Fields Mapping) when creating an database output.&lt;/P&gt;

&lt;P&gt;Please check the following Splunk doc. &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/DBX/3.1.3/DeployDBX/Createandmanagedatabaseoutputs#Fields_mapping" target="_blank"&gt;http://docs.splunk.com/Documentation/DBX/3.1.3/DeployDBX/Createandmanagedatabaseoutputs#Fields_mapping&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have tested this funtionality using EMPLOYEES table on Oracle database and it worked for me. After configuring the database output using DB Connect UI,  $SPLUNK_HOME/etc/apps/splunk_app_db_connect/local/db_outputs.conf shows the following. Please note that EMPLOYEE_ID is configured for unique_key and using_upsert as 1 below: &lt;/P&gt;

&lt;P&gt;db_outputs.conf&lt;BR /&gt;
[EMP]&lt;BR /&gt;
connection = oracle&lt;BR /&gt;
customized_mappings = COMMISSION_PCT:COMMISSION_PCT:3,DEPARTMENT_ID:DEPARTMENT_ID:3,EMAIL:EMAIL:12,EMPLOYEE_ID:EMPLOYEE_ID:3,FIRST_NAME:FIRST_NAME:12,JOB_ID:JOB_ID:12,LAST_NAME:LAST_NAME:12,HIRE_DATE:HIRE_DATE:93,PHONE_NUMBER:PHONE_NUMBER:12,SALARY:SALARY:3,MANAGER_ID:MANAGER_ID:3&lt;BR /&gt;
disabled = 0&lt;BR /&gt;
is_saved_search = 0&lt;BR /&gt;
scheduled = 0&lt;BR /&gt;
search = index=main sourcetype=dbx | search EMPLOYEE_ID=173&lt;BR /&gt;
table_name = "SPLUNK"."EMPLOYEES"&lt;BR /&gt;
ui_query_schema = SPLUNK&lt;BR /&gt;
ui_query_table = EMPLOYEES&lt;BR /&gt;
&lt;STRONG&gt;unique_key = EMPLOYEE_ID&lt;BR /&gt;
using_upsert = 1&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-update-database-table-rows-with-Splunk-data/m-p/384240#M46753</guid>
      <dc:creator>kheo_splunk</dc:creator>
      <dc:date>2020-09-29T19:29:54Z</dc:date>
    </item>
  </channel>
</rss>

