<?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 Splunk DB Connect 1: How to use the transaction command with dbquery? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191100#M187178</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to run the transaction command on a SQL query with DB Connect 1.&lt;BR /&gt;
My problem is when I am using the following query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbquery &amp;lt;connection&amp;gt; &amp;lt;SQL Search&amp;gt; | transaction &amp;lt;file_id&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get :&lt;BR /&gt;
No results found&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&amp;lt; file_id&amp;gt;&lt;/STRONG&gt; - is the column  I need to group by.&lt;BR /&gt;
The Query itself is working if I remove the transaction part.&lt;/P&gt;

&lt;P&gt;Also, If I run use transaction on an index, it's working fine.&lt;/P&gt;

&lt;P&gt;Any help is appreciated,&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
    <pubDate>Sun, 23 Aug 2015 15:34:32 GMT</pubDate>
    <dc:creator>avivn</dc:creator>
    <dc:date>2015-08-23T15:34:32Z</dc:date>
    <item>
      <title>Splunk DB Connect 1: How to use the transaction command with dbquery?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191100#M187178</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to run the transaction command on a SQL query with DB Connect 1.&lt;BR /&gt;
My problem is when I am using the following query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbquery &amp;lt;connection&amp;gt; &amp;lt;SQL Search&amp;gt; | transaction &amp;lt;file_id&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get :&lt;BR /&gt;
No results found&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&amp;lt; file_id&amp;gt;&lt;/STRONG&gt; - is the column  I need to group by.&lt;BR /&gt;
The Query itself is working if I remove the transaction part.&lt;/P&gt;

&lt;P&gt;Also, If I run use transaction on an index, it's working fine.&lt;/P&gt;

&lt;P&gt;Any help is appreciated,&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2015 15:34:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191100#M187178</guid>
      <dc:creator>avivn</dc:creator>
      <dc:date>2015-08-23T15:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to use the transaction command with dbquery?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191101#M187179</link>
      <description>&lt;P&gt;If you do &lt;CODE&gt;table file_id&lt;/CODE&gt; do you get the values you expect coming back or not? (do you have the case of the field name correct? does it actually have dots in it)? Do you want &lt;CODE&gt;transaction&lt;/CODE&gt; or are you actually wanting to use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/stats"&gt;stats&lt;/A&gt; e.g. &lt;CODE&gt;stats count by file_id&lt;/CODE&gt; or &lt;CODE&gt;stats list(*) as * by file_id&lt;/CODE&gt; or something else? (What are you wanting to do after the transaction command?)&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2015 18:26:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191101#M187179</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-08-23T18:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to use the transaction command with dbquery?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191102#M187180</link>
      <description>&lt;P&gt;First of all thanks for the help.&lt;BR /&gt;
I tried to do &lt;CODE&gt;| table * | transaction file_id&lt;/CODE&gt; and got no results as well.&lt;BR /&gt;
I do need the functionality of the transaction because in the sql table, every time there is a status update in another table it adds a line to the table I am trying to query, So I need to have a single line of each &lt;CODE&gt;file_id&lt;/CODE&gt; with the latest status data.&lt;BR /&gt;
After the transaction function I want to continue work with other columns, but now I'll know I'm working on the latest status data.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 08:57:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191102#M187180</guid>
      <dc:creator>avivn</dc:creator>
      <dc:date>2015-08-25T08:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to use the transaction command with dbquery?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191103#M187181</link>
      <description>&lt;P&gt;so if you are after the latest by an id, stats should help you:&lt;BR /&gt;
    | dbquery ... | stats latest(status) as latest latest(foo) as foo latest(bar) as bar by file_id&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 13:20:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191103#M187181</guid>
      <dc:creator>dturnbull_splun</dc:creator>
      <dc:date>2015-08-25T13:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to use the transaction command with dbquery?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191104#M187182</link>
      <description>&lt;P&gt;So you have a join of 2 tables in your SQL statement, and you're looking for the latest for each file_id... I'm assuming that when you run the query without the transaction the field you're looking to operate on is exactly &lt;CODE&gt;file_id&lt;/CODE&gt; (both punctuation and case matter when it comes to field names). Now if your sql query sorts appropriately by status update, you could use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/dedup" target="_blank"&gt;dedup file_id&lt;/A&gt; instead of transaction. Or if your status update time field is correctly read as the  _time as a unix timestamp, you might even be able to use &lt;CODE&gt;stats latest(*) as * by file_id&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:04:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191104#M187182</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2020-09-29T07:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How to use the transaction command with dbquery?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191105#M187183</link>
      <description>&lt;P&gt;Hey,&lt;BR /&gt;
Ended up using dedup file_id instead of using transaction like @acharlieh suggested and it works great !&lt;BR /&gt;
Thank you both for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 08:38:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-DB-Connect-1-How-to-use-the-transaction-command-with/m-p/191105#M187183</guid>
      <dc:creator>avivn</dc:creator>
      <dc:date>2015-08-27T08:38:38Z</dc:date>
    </item>
  </channel>
</rss>

