Добрый день!
Имеется скрипт для log parser
PHP код:
@echo off
setlocal enableextensions enabledelayedexpansion
set sSourceFile=C:Users1Desktopdis_def_print2.txt
set sFromDateTime=2013-05-05
set sToDateTime=2014-12-15
"%ProgramFiles%\Log Parser 2.2\LogParser.exe" "SELECT Field4 AS [Document ID], COUNT([Document ID]) AS [Total] USING TO_TIMESTAMP(STRCAT(STRCAT(Field1, ' '), Field2),'yyyy-MM-dd hh:mm:ss.ll') AS Date INTO DATAGRID FROM '%sSourceFile%' WHERE Field3 = 'print' AND TO_TIMESTAMP('%sFromDateTime%', 'yyyy-MM-dd') <= Date AND TO_TIMESTAMP('%sToDateTime%', 'yyyy-MM-dd') >= Date GROUP BY [Document ID] ORDER BY Total DESC" -i:TSV -iSeparator:space -headerRow:OFF -nSkipLines:2 -iTsFormat:"yyyy-MM-dd hh:mm:ss.ll" -iCodepage:1251 -stats:OFF -rtp:-1
endlocal
exit /b 0
Лог:
PHP код:
Document ID User ID
2014-01-22 18:07:02.600 print /rsl01005000000/rsl01005394000/rsl01005394743/rsl01005394743.pd 122 194409
2014-01-22 19:45:04.033 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 123 874893
2014-01-22 19:45:05.147 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 966 874893
2014-01-22 19:45:06.270 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 322 874893
2014-01-22 19:45:07.350 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 238 874893
2014-01-22 19:45:08.890 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 239 874893
2014-01-22 19:45:09.973 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 240 874893
2014-01-22 19:45:11.177 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 241 874893
2014-01-22 19:45:12.270 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 242 874893
2014-01-22 19:45:13.480 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 362 874893
2014-01-22 19:45:14.583 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 363 874893
2014-01-22 19:45:16.223 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 364 874893
2014-01-22 19:45:17.757 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 365 874893
2014-01-22 19:45:19.067 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 366 874893
2014-01-22 19:45:20.507 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 367 874893
2014-01-23 10:12:07.003 print /rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd NULL 929239
При формировании результата выводится окно с уникальными DOCUMENT ID и количеством значений Total.
Подскажите сделать так чтобы он выводил уникальные документы для каждого значения USER ID?
Пример результата:
PHP код:
/rsl01005000000/rsl01005394000/rsl01005394743/rsl01005394743.pd 1 194409
/rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 14 874893
/rsl01003000000/rsl01003318000/rsl01003318639/rsl01003318639.pd 1 929239