Сохраните и очистите eventlogs

Если Вы находитесь на командной строке Linux/UNIX:

svn status | grep '\?' | awk '{print $2;}' | xargs svn add
3
задан 7 January 2013 в 14:40
1 ответ

Существует инструмент SysInternals, который вы можете использовать для этого, который называется PSLogList . Это заменяет файл EventLog.pl из Windows 2K.

Вам потребуется использовать параметр -c , чтобы очистить журналы после команды, и -g , чтобы указать файл. (по какой-то странной причине -g отсутствует в справке по использованию).

usage: psloglist [- ] [\\computer[,computer[,...] | @file [-u username [-p password]]] [-s [-t delimiter]] [-m #|-n #|-h #|-d #|-w][-c][-x][-r][-a mm/dd/yy][-b mm/dd/yy][-f filter] [-i ID[,ID[,...] | -e ID[,ID[,...]]] [-o event source[,event source][,..]]] [-q event source[,event source][,..]]] [-l event log file] <eventlog>

@file   Execute the command on each of the computers listed in the file.
-a  Dump records timestamped after specified date.
-b  Dump records timestamped before specified date.
-c  Clear the event log after displaying.
-d  Only display records from previous n days.
-c  Clear the event log after displaying.
-e  Exclude events with the specified ID or IDs (up to 10).
-f  Filter event types with filter string (e.g. "-f w" to filter warnings).
-h  Only display records from previous n hours.
-i  Show only events with the specified ID or IDs (up to 10).
-l  Dump records from the specified event log file.
-m  Only display records from previous n minutes.
-n  Only display the number of most recent entries specified.
-o  Show only records from the specified event source (e.g. \"-o cdrom\").
-p  Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.
-q  Omit records from the specified event source or sources (e.g. \"-q cdrom\").
-r  SDump log from least recent to most recent.
-s  This switch has PsLogList print Event Log records one-per-line, with comma delimited fields. This format is convenient for text searches, e.g. psloglist | findstr /i text, and for importing the output into a spreadsheet.
-t  The default delimeter is a comma, but can be overriden with the specified character.
-u  Specifies optional user name for login to remote computer.
-w  Wait for new events, dumping them as they generate (local system only).
-x  Dump extended data
eventlog    eventlog

Если вам нужна команда, которую можно выполнить удаленно, вам понадобится что-то вроде этого:

psexec \\servername -c psloglist.exe -c -g application.evt application
3
ответ дан 3 December 2019 в 06:41

Теги

Похожие вопросы