<?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: dbquery show database name in results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165786#M186078</link>
    <description>&lt;P&gt;Well, it isn't necessarily the database name that I'd want to show per-se, I'd either show the name of the connector that I'm calling (I.E. NPS-01) or hard code a string to show "server-01" or whatever.&lt;/P&gt;

&lt;P&gt;For example, in splunk graphing, it's possible to add a dummy static value to appear on a chart by doing an eval.&lt;/P&gt;</description>
    <pubDate>Thu, 15 May 2014 18:37:58 GMT</pubDate>
    <dc:creator>Lazarix</dc:creator>
    <dc:date>2014-05-15T18:37:58Z</dc:date>
    <item>
      <title>dbquery show database name in results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165784#M186076</link>
      <description>&lt;P&gt;When using the DB connector, is it possible to show either the hostname or a fixed string alongside the query results?&lt;BR /&gt;
The reason is, I have a dbquery which uses |append that talks to multiple databases to show the results in one table.&lt;BR /&gt;
It queries 7 hosts and pulls out some information from the same database name in each host, but when it finds a result, I am not sure which host it has found the information in.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbquery "NPS-01"  "select * from _v_dslice where DS_STATUS='Healthy' order by ds_id" | append [| dbquery "NPS-03"  "select * from _v_dslice where DS_STATUS='Healthy' order by ds_id"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It will show both results in one table, which is great but I would be happy with an additional column that shows the hostname alongside each query result.&lt;BR /&gt;
I would be fine with reporting a hard coded string along with each query if that would solve it.&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2014 15:20:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165784#M186076</guid>
      <dc:creator>Lazarix</dc:creator>
      <dc:date>2014-05-15T15:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: dbquery show database name in results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165785#M186077</link>
      <description>&lt;P&gt;Depending upon what database you're using, you could use SQL to &lt;A href="http://stackoverflow.com/questions/5479693/retrieve-server-name-and-database-name-from-stored-procedure"&gt;fetch the database name&lt;/A&gt;. Then you could use the &lt;A href="http://stackoverflow.com/questions/17882951/add-column-to-sql-query-results"&gt;union SQL command&lt;/A&gt; to append it in a column. I don't think this would be possible using the splunk search language, unless you wanted to hardcode it.&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2014 18:15:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165785#M186077</guid>
      <dc:creator>ilink_splunk</dc:creator>
      <dc:date>2014-05-15T18:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: dbquery show database name in results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165786#M186078</link>
      <description>&lt;P&gt;Well, it isn't necessarily the database name that I'd want to show per-se, I'd either show the name of the connector that I'm calling (I.E. NPS-01) or hard code a string to show "server-01" or whatever.&lt;/P&gt;

&lt;P&gt;For example, in splunk graphing, it's possible to add a dummy static value to appear on a chart by doing an eval.&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2014 18:37:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165786#M186078</guid>
      <dc:creator>Lazarix</dc:creator>
      <dc:date>2014-05-15T18:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: dbquery show database name in results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165787#M186079</link>
      <description>&lt;P&gt;yes you can, &lt;CODE&gt;|eval dbconnector=xxx|field + dbconnector&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|stats count by dbconnector&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2014 18:47:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165787#M186079</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-05-15T18:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: dbquery show database name in results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165788#M186080</link>
      <description>&lt;P&gt;Unknown search command 'field'&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2014 09:10:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165788#M186080</guid>
      <dc:creator>Lazarix</dc:creator>
      <dc:date>2014-05-19T09:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: dbquery show database name in results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165789#M186081</link>
      <description>&lt;P&gt;&lt;CODE&gt;...|eval dbconnector=xxx|fields + dbconnector&lt;BR /&gt;
|stats count by dbconnector&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2014 13:47:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165789#M186081</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-05-19T13:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: dbquery show database name in results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165790#M186082</link>
      <description>&lt;P&gt;Unfortunately that doesn't return any results &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2014 14:33:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165790#M186082</guid>
      <dc:creator>Lazarix</dc:creator>
      <dc:date>2014-05-19T14:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: dbquery show database name in results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165791#M186083</link>
      <description>&lt;P&gt;does your dbquery return any records? eval should be placed after your parent query.&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2014 15:07:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/dbquery-show-database-name-in-results/m-p/165791#M186083</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-05-19T15:07:29Z</dc:date>
    </item>
  </channel>
</rss>

