<?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: Splunk DB Connect: How to get count of db queries run in Splunk environment? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-get-count-of-db-queries-run-in-Splunk/m-p/242435#M27445</link>
    <description>&lt;P&gt;the number of queries dbconnect issues ?&lt;BR /&gt;
If so, at the most basic.. something like this  maybe?&lt;/P&gt;

&lt;P&gt;index=_internal source=*dbx_query_audit.log sourcetype=dbx_query_audit  action=sql_audit|stats count by sql&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 11:50:40 GMT</pubDate>
    <dc:creator>jbarlow_splunk</dc:creator>
    <dc:date>2020-09-29T11:50:40Z</dc:date>
    <item>
      <title>Splunk DB Connect: How to get count of db queries run in Splunk environment?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-get-count-of-db-queries-run-in-Splunk/m-p/242434#M27444</link>
      <description>&lt;P&gt;how to get count of db queries run in Splunk environment? please help me with  splunk query .  &lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 21:00:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-get-count-of-db-queries-run-in-Splunk/m-p/242434#M27444</guid>
      <dc:creator>sravankaripe</dc:creator>
      <dc:date>2016-11-18T21:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: How to get count of db queries run in Splunk environment?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-get-count-of-db-queries-run-in-Splunk/m-p/242435#M27445</link>
      <description>&lt;P&gt;the number of queries dbconnect issues ?&lt;BR /&gt;
If so, at the most basic.. something like this  maybe?&lt;/P&gt;

&lt;P&gt;index=_internal source=*dbx_query_audit.log sourcetype=dbx_query_audit  action=sql_audit|stats count by sql&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:50:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-get-count-of-db-queries-run-in-Splunk/m-p/242435#M27445</guid>
      <dc:creator>jbarlow_splunk</dc:creator>
      <dc:date>2020-09-29T11:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: How to get count of db queries run in Splunk environment?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-get-count-of-db-queries-run-in-Splunk/m-p/242436#M27446</link>
      <description>&lt;P&gt;Have you looked at DB2 Health Dashboard? There are several panels like&lt;/P&gt;

&lt;P&gt;DB Connect Health - No of Transaction over time&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count as count from datamodel=DB_Health where `health_filter(*, *, *)` groupby "All_Records.CONNECTION", _time prestats=false summariesonly=false | rename All_Records.* as * | timechart sum(count) as abc by CONNECTION
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;DB Connect Health - Status by Transaction Type&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats values(All_Records.CONNECTION) as CONNECTION values(All_Records.DB_USER) as DB_USER values(All_Records.FUNCTION) as FUNCTION values(All_Records.STATE) as STATE from datamodel=DB_Health groupby "All_Records.TRANS_OBJECT_ID" | rename All_Records.* as * | eval FUNCTION=mvfilter(match(FUNCTION, "py_*")) | `health_transaction_filter(*, *, *)` |  stats count(eval(mvfind(STATE,"error"))) as Failure count as Total by FUNCTION | eval Success=(Total-Failure) | stats sum(Failure) as Failure sum(Success) as Success by FUNCTION
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;DB Connect Health - Transaction &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats values(All_Records.STATE) as STATE values(All_Records.CONNECTION) as All_Records.CONNECTION values(All_Records.DB_USER) as All_Records.DB_USER values(All_Records.ERROR_CODE) as All_Records.ERROR_CODE values(All_Records.JDBC_USE_SSL) as All_Records.JDBC_USE_SSL values(All_Records.DURATION) as All_Records.DURATION values(All_Records.MEMORY_USED) as All_Records.MEMORY_USED count as count from datamodel=DB_Health  groupby "All_Records.TRANS_OBJECT_ID",_time,"All_Records.MESSAGE","All_Records.FUNCTION"
             | rename All_Records.* as *
             | replace database with "" in MESSAGE
             | stats list(STATE) as STATE list(MESSAGE) as MESSAGE list(FUNCTION) as FUNCTION first(CONNECTION) as CONNECTION first(DB_USER) as DB_USER values(ERROR_CODE) as ERROR_CODE values(DURATION) as DURATION values(JDBC_USE_SSL) as JDBC_USE_SSL latest(_time) as _time max(MEMORY_USED) as MEMORY_USED by TRANS_OBJECT_ID
             | `health_transaction_filter(*, *, *)`
             | mvexpand FUNCTION
             | search FUNCTION=py_*
             | replace null* with * in MESSAGE
             | eval ERROR = mvfilter(match(STATE, "error"))
             | eval COMPLETED = mvindex(mvfilter(match(STATE, "completed")), 1)
             | fillnull value=null COMPLETED ERROR |eval MEMORY_USED=MEMORY_USED/1000
             | stats first(COMPLETED) as COMPLETED first(ERROR) as ERROR first(MESSAGE) as MESSAGE first(FUNCTION) as "Transaction Type" first(CONNECTION) as Connection first(DB_USER) as Identity first(ERROR_CODE) as ERROR_CODE first(DURATION) as Duration values(JDBC_USE_SSL) as SSL first(MEMORY_USED) as "Connection Used Mem(MB)" by TRANS_OBJECT_ID _time
             | eval Status=case(ERROR_CODE==400, "Error", len(MESSAGE)&amp;gt;0, "Error", ERROR="error", "Error", COMPLETED!="completed", "In Progress", len(MESSAGE)==0, "Success")
             | rename TRANS_OBJECT_ID as Transaction
             | table _time Transaction Connection "Transaction Type" Identity Status SSL Duration "Connection Used Mem(MB)"
             | fillnull SSL value=False
             | fillnull value="In Progress" Status
             | eval Duration=round(Duration, 2)
             | sort -_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can tweak these and many more as per your need.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 07:45:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-get-count-of-db-queries-run-in-Splunk/m-p/242436#M27446</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-11-20T07:45:55Z</dc:date>
    </item>
  </channel>
</rss>

