<?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: Why does the dbxquery break when put into the dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421997#M27817</link>
    <description>&lt;P&gt;Cool, yeah, double $ work well, thanks a lot! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 May 2018 12:45:40 GMT</pubDate>
    <dc:creator>DerBastler</dc:creator>
    <dc:date>2018-05-29T12:45:40Z</dc:date>
    <item>
      <title>Why does the dbxquery break when put into the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421992#M27812</link>
      <description>&lt;P&gt;Hey there,&lt;/P&gt;

&lt;P&gt;I stumbled over an issue with a dbxquery. While it works perfectly fine outside of a dashboard, it breaks when I put it into the dashboard.&lt;/P&gt;

&lt;P&gt;I am basically putting together a query like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table myips
| eval myquery = "SELECT yadda yadda WHERE data_ip in (".myips.");"
| map search="| dbxquery connection=SomeDatabase query=$myquery$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it works perfectly fine, however once I put it into a dashboard it starts to break.&lt;BR /&gt;
First, the dashboard is looking for input. If I create a dummy inputfield with the token myquery, it will give out an error:&lt;BR /&gt;
"[map]: At least a query or stored procedure parameter is required."&lt;/P&gt;

&lt;P&gt;I also tried to put it together and mix the double quotes with the single quotes but that doesn't work either.&lt;/P&gt;

&lt;P&gt;Do you have any other idea on how to do that? Just using dbxquery without the map command is not working either as the db connection has to occur in the middle of the splunk query.&lt;/P&gt;</description>
      <pubDate>Mon, 28 May 2018 15:11:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421992#M27812</guid>
      <dc:creator>DerBastler</dc:creator>
      <dc:date>2018-05-28T15:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the dbxquery break when put into the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421993#M27813</link>
      <description>&lt;P&gt;@DerBastler, have you tried the following in dashboard?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourCurrentSearch&amp;gt;
| table myips
| map search="| dbxquery connection=SomeDatabase query=\"SELECT yadda yadda WHERE data_ip in (\"$myips$\")\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 May 2018 17:14:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421993#M27813</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-28T17:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the dbxquery break when put into the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421994#M27814</link>
      <description>&lt;P&gt;Keeping the the (\".myips.\") intact breaks with an error:&lt;/P&gt;

&lt;P&gt;expected something between '(' and '.'.&lt;BR /&gt;
so likely escaping the field breaks it.&lt;/P&gt;

&lt;P&gt;also exchanging this to (\"$myips$\")\"&lt;BR /&gt;
as described in your example results in the old problem that the dashboard is waiting for some input for myips.&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 09:23:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421994#M27814</guid>
      <dc:creator>DerBastler</dc:creator>
      <dc:date>2018-05-29T09:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the dbxquery break when put into the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421995#M27815</link>
      <description>&lt;P&gt;Can you try escaping &lt;CODE&gt;$&lt;/CODE&gt; with &lt;CODE&gt;$$&lt;/CODE&gt; i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(\"$$myips$$\")\"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;One more thing you can try is using token with string escaping i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;($myips|s$)\"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I will try to mimic with similar map command use case as I current do not have DB Connect to test &lt;CODE&gt;dbxquery&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 12:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421995#M27815</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-29T12:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the dbxquery break when put into the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421996#M27816</link>
      <description>&lt;P&gt;@DerBastler, please try the following. You need to escape the &lt;CODE&gt;$&lt;/CODE&gt; sign in token with &lt;CODE&gt;$$&lt;/CODE&gt; in the dashboard:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;yourCurrentSearch&amp;gt;
 | table myips
 | map search="| dbxquery connection=SomeDatabase query=\"SELECT yadda yadda WHERE data_ip in (\"$$myips$$\")\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm!&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 12:38:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421996#M27816</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-29T12:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the dbxquery break when put into the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421997#M27817</link>
      <description>&lt;P&gt;Cool, yeah, double $ work well, thanks a lot! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 12:45:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-does-the-dbxquery-break-when-put-into-the-dashboard/m-p/421997#M27817</guid>
      <dc:creator>DerBastler</dc:creator>
      <dc:date>2018-05-29T12:45:40Z</dc:date>
    </item>
  </channel>
</rss>

