<?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: Extracting cancelled transactions from logs. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/611029#M212472</link>
    <description>&lt;P&gt;How long might it be until the re-try is successful?&amp;nbsp; You can try extending the time span of the transaction (&lt;FONT face="courier new,courier"&gt;maxspan&lt;/FONT&gt; option), but that may not help if it takes a long time for the re-try.&amp;nbsp; Also, longer transactions use more memory and make the search run longer.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2022 23:52:55 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-08-26T23:52:55Z</dc:date>
    <item>
      <title>How to extract cancelled transactions from logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/610799#M212420</link>
      <description>&lt;P&gt;&amp;nbsp;I'm looking at events and I'm trying to determine which files are not "deleted" from the folder on a server after files have been 'uploaded'. If the file is deleted it means it has been successfully transferred. I'm able to use the 'transaction' command to determine the duration of a successful file transfer, however, I'm not able to figure out which files are stuck in the folder since the 'delete' event did not occur for some files. Help would be appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what i have so far, but needs fixing to determine which files are "stuck"...I think a join might be needed?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=main* ("Found new file" OR "Deleted file") 
| rex field=_raw "Found new file .*\\\\(?P&amp;lt;files&amp;gt;.*)\"}"
| rex field=_raw "Deleted file (?P&amp;lt;files&amp;gt;.*)\"}"
| transaction user files keepevicted=t mvlist=true startswith="Found new file" endswith="Deleted file"
| table user files duration _raw
| sort _time desc
| where duration=0&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Aug 2022 14:04:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/610799#M212420</guid>
      <dc:creator>syed</dc:creator>
      <dc:date>2022-08-25T14:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting cancelled transactions from logs.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/610807#M212425</link>
      <description>&lt;P&gt;The current &lt;FONT face="courier new,courier"&gt;transaction&lt;/FONT&gt; command will find only completed transactions, that is, those with both "Found new file" and "Deleted file" events.&amp;nbsp; To find files that were not deleted, you want to locate "orphan" transactions - those with a matching &lt;FONT face="courier new,courier"&gt;startswith&lt;/FONT&gt; and no matching &lt;FONT face="courier new,courier"&gt;endswith&lt;/FONT&gt;.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;keeporphans&lt;/FONT&gt; option should do it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main* ("Found new file" OR "Deleted file") 
| rex field=_raw "Found new file .*\\\\(?P&amp;lt;files&amp;gt;.*)\"}"
| rex field=_raw "Deleted file (?P&amp;lt;files&amp;gt;.*)\"}"
| transaction user files keepevicted=t keeporphans=t mvlist=true startswith="Found new file" endswith="Deleted file"
| where _txn_orphan=1
| table user files duration _raw
| sort _time desc
| where duration=0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 12:43:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/610807#M212425</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-08-25T12:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting cancelled transactions from logs.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/610851#M212436</link>
      <description>&lt;P&gt;Unfortunately, I get no results when searched over 30 days.&amp;nbsp; Would there be another way to tackle this search out side of the transaction command perhaps?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 17:16:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/610851#M212436</guid>
      <dc:creator>syed</dc:creator>
      <dc:date>2022-08-25T17:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting cancelled transactions from logs.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/610863#M212438</link>
      <description>&lt;P&gt;Try removing the &lt;FONT face="courier new,courier"&gt;| where duration=0&lt;/FONT&gt; line.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 18:04:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/610863#M212438</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-08-25T18:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting cancelled transactions from logs.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/610871#M212440</link>
      <description>&lt;P&gt;So this is t&lt;SPAN&gt;his is showing the files that failed but it doesn't take into account for them successfully transfer after the failure.&amp;nbsp;How can we take the data from this and then run a subsearch to see if they upload after the first failure? Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 19:45:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/610871#M212440</guid>
      <dc:creator>syed</dc:creator>
      <dc:date>2022-08-25T19:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting cancelled transactions from logs.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/611029#M212472</link>
      <description>&lt;P&gt;How long might it be until the re-try is successful?&amp;nbsp; You can try extending the time span of the transaction (&lt;FONT face="courier new,courier"&gt;maxspan&lt;/FONT&gt; option), but that may not help if it takes a long time for the re-try.&amp;nbsp; Also, longer transactions use more memory and make the search run longer.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 23:52:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/611029#M212472</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-08-26T23:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting cancelled transactions from logs.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/611087#M212490</link>
      <description>&lt;P&gt;Using transaction command over a long period is perhaps not the best solution for this, as memory constraints can result in the results not being correct. You can probably use stats to perform the same thing, e.g. this search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main* ("Found new file" OR "Deleted file") 
| rex field=_raw "Found new file .*\\\\(?P&amp;lt;files&amp;gt;.*)\"}"
| rex field=_raw "Deleted file (?P&amp;lt;files&amp;gt;.*)\"}"
| eval deleted=if(match(_raw, "Deleted file"), 1, 0)
| stats earliest(_time) as earliest latest(_time) as latest max(deleted) as deleted by user files
| where deleted=0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;will provide a table of the earliest/latest times of 'user' and 'files'. It works by setting the 'deleted' field to 1 if the file is deleted and 0 if there is no deleted message. The where clause will remove any rows where the file has not been deleted.&lt;/P&gt;&lt;P&gt;Using stats will certainly perform faster than transaction and be reliable, as it won't have memory constraints.&lt;/P&gt;&lt;P&gt;You can perform calculates after the stats to get duration if needed&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 05:10:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-cancelled-transactions-from-logs/m-p/611087#M212490</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-29T05:10:50Z</dc:date>
    </item>
  </channel>
</rss>

