<?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: FTP file staistics in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105710#M27429</link>
    <description>&lt;P&gt;Thanks for your quick response, that was useful. However this query gives result for particular user only. I am looking to compute the statistics for all the users.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2013 09:05:26 GMT</pubDate>
    <dc:creator>srajanbabu</dc:creator>
    <dc:date>2013-10-18T09:05:26Z</dc:date>
    <item>
      <title>FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105708#M27427</link>
      <description>&lt;P&gt;I am new to spluk, I have the below sample log and would like to arrive statistics on userwise how many files/Bytes retrived/FTPed. Please guide me to accomplish this task.&lt;/P&gt;

&lt;P&gt;0004 rajan.#### :: 04/03/13 00:00:34 :: User rajan logged in&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:27 :: User logged off, Processing will begin&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:27 :: Transmission type set to Binary&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:27 :: Customer retrieved file xxxxxxxxx_G3INF0000000108647.CSV.PGP  62619 bytes transferred&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:27 :: Customer has successfully retrieved file xxxxxxxxx_G3INF0000000108647.CSV.PGP (123 records/62619 bytes)&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:27 :: FTPWATCH: (saf_file) SAF_INFO returned WINT1TBY,153F,123,62619&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:29 :: 125 Storing data set xxxxxxxxx.T000029.rajan.S000f&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:29 :: 250 Transfer completed successfully.&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:31 :: 125 Storing data set xxxxxxxxx.T000030.WINT1TBY.S000f&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:31 :: 250 Transfer completed successfully.&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:31 :: File xxxxxxxxx_G3INF0000000108647.CSV.PGP was an SAF from WINT1TBY.153F&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:31 :: No delete option was set for file xxxxxxxxx_G3INF0000000108647.CSV.PGP&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:31 :: Transmission type set to Binary&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:31 :: Customer retrieved file xxxxxxxxx_20130402.CSV.PGP  5656 bytes transferred&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:31 :: Customer has successfully retrieved file xxxxxxxxx_20130402.CSV.PGP (12 records/5656 bytes)&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:31 :: FTPWATCH: (saf_file) SAF_INFO returned WINT1TBY,741F,12,5656&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:33 :: 125 Storing data set xxxxxxxxx.T000032.rajan.S000f&lt;BR /&gt;
0004 rajan.000f :: 04/03/13 00:00:33 :: 250 Transfer completed successfully.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:00:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105708#M27427</guid>
      <dc:creator>srajanbabu</dc:creator>
      <dc:date>2020-09-28T15:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105709#M27428</link>
      <description>&lt;P&gt;The example query below will give you the number of files, records and bytes transferred per user. Assumptions; &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;no fields are previously extracted and will thus be made inline with &lt;CODE&gt;rex&lt;/CODE&gt;, &lt;/LI&gt;
&lt;LI&gt;all relevant information can be found in the 'Customer has successfully retrieved...' messages&lt;/LI&gt;
&lt;LI&gt;user name is found in beginning of the line (between '0004 ' and '.000f')&lt;/LI&gt;
&lt;LI&gt;timestamps are already being parsed correctly&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;index=blah sourcetype=bleh "Customer has successfully retrieved file" &lt;BR /&gt;
| rex "^\S+\s(?&amp;lt;userid&amp;gt;\S+)\s" &lt;BR /&gt;
| rex "\((?&amp;lt;record_count&amp;gt;\d+)\srecords/(?&amp;lt;byte_count&amp;gt;\d+)\sbytes\)$" &lt;BR /&gt;
| stats count as FileCount sum(record_count) as RecordCount sum(byte_count) as ByteCount by userid&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;EDIT: &lt;CODE&gt;userid&lt;/CODE&gt; regex now includes all characters between the first and second space.&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 07:20:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105709#M27428</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-18T07:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105710#M27429</link>
      <description>&lt;P&gt;Thanks for your quick response, that was useful. However this query gives result for particular user only. I am looking to compute the statistics for all the users.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:05:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105710#M27429</guid>
      <dc:creator>srajanbabu</dc:creator>
      <dc:date>2013-10-18T09:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105711#M27430</link>
      <description>&lt;P&gt;No. Or well. IF the user information is located where I assumed, the search will give the statistics &lt;EM&gt;per user&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;Note that my regex stipulates that userid's should contain only 'word' characters (&lt;CODE&gt;\w&lt;/CODE&gt;). So if they contain &lt;CODE&gt;#.-!&lt;/CODE&gt; etc, they won't be extracted.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 09:30:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105711#M27430</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-18T09:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105712#M27431</link>
      <description>&lt;P&gt;The prvivded search works for user id end with .000f only, typical userid will suffixed with some numbers such as YAHOO3SN.871F, ANALF4DY.874F,FISGMEFX.880F etc.,&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 10:02:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105712#M27431</guid>
      <dc:creator>srajanbabu</dc:creator>
      <dc:date>2013-10-18T10:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105713#M27432</link>
      <description>&lt;P&gt;which part &lt;EM&gt;exactly&lt;/EM&gt; is the username?&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;rajan&lt;/LI&gt;
&lt;LI&gt;rajan.000f&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 18 Oct 2013 10:08:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105713#M27432</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-18T10:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105714#M27433</link>
      <description>&lt;P&gt;updated the regex to capture more characters. see above.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 10:17:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105714#M27433</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-18T10:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105715#M27434</link>
      <description>&lt;P&gt;&lt;RAJAN&gt; is the user-id, the search is much better with new regex, thanks a lot for taking time to answer.&lt;/RAJAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 10:42:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105715#M27434</guid>
      <dc:creator>srajanbabu</dc:creator>
      <dc:date>2013-10-18T10:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105716#M27435</link>
      <description>&lt;P&gt;I am able make out the regex what I want. I an done thanks a lot.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 11:03:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105716#M27435</guid>
      <dc:creator>srajanbabu</dc:creator>
      <dc:date>2013-10-18T11:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105717#M27436</link>
      <description>&lt;P&gt;Well, maybe you figured out how to do it yourself, but if you DON'T want the 'second' part, i.e. '.123X', you can write the regex as;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;rex "^\S+\s(?&amp;lt;userid&amp;gt;[^.]+)\.\S+\s"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;which reads as;&lt;/P&gt;

&lt;P&gt;from the start;&lt;BR /&gt;
- one or more non-space characters  (the 0004)&lt;BR /&gt;
- one space character (space or tab)&lt;BR /&gt;
- one or more non-dot characters (this is what we capture as &lt;CODE&gt;userid&lt;/CODE&gt;)&lt;BR /&gt;
- a single dot (hey, a dot)&lt;BR /&gt;
- one or more non-space character (000F, 871F etc)&lt;BR /&gt;
- one space character (space or tab)&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 12:05:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105717#M27436</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-18T12:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105718#M27437</link>
      <description>&lt;P&gt;yea, that works except the filename is missing in the seach result. Below is the regex, the search result to include filename,  which appears next to "Customer has successfully retrieved file", can you help me how do i include that in the search result.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=main sourcetype=summa "Customer has successfully retrieved file" | rex "^\S+\s(?&amp;lt;userid&amp;gt;\S+)\." | rex "\((?&amp;lt;record_count&amp;gt;\d+)\srecords/(?&amp;lt;byte_count&amp;gt;\d+)\sbytes\)$" | stats count as FileCount sum(record_count) as RecordCount sum(byte_count) as ByteCount by userid&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 12:53:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105718#M27437</guid>
      <dc:creator>srajanbabu</dc:creator>
      <dc:date>2013-10-18T12:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105719#M27438</link>
      <description>&lt;P&gt;Change your second &lt;CODE&gt;rex&lt;/CODE&gt; to;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rex "\s(?&amp;lt;file_name&amp;gt;\S+)\s\((?&amp;lt;record_count&amp;gt;\d+)\srecords/(?&amp;lt;byte_count&amp;gt;\d+)\sbytes\)$"&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;and rewrite your &lt;CODE&gt;stats&lt;/CODE&gt; to;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats count as FileCount list(file_name) as FileName sum(record_count) as RecordCount sum(byte_count) as ByteCount by userid&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Combined, this will add a list of the file names transferred. &lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 13:06:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105719#M27438</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-18T13:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: FTP file staistics</title>
      <link>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105720#M27439</link>
      <description>&lt;P&gt;Awesome, thanks a lot&lt;/P&gt;

&lt;P&gt;Rajan&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 13:39:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/FTP-file-staistics/m-p/105720#M27439</guid>
      <dc:creator>srajanbabu</dc:creator>
      <dc:date>2013-10-18T13:39:55Z</dc:date>
    </item>
  </channel>
</rss>

