读取日志解析器递归文件 [英] Log Parser recursive file read
问题描述
我正在尝试使用Microsoft的Log Parser读取多组IIS日志文件.现在,我的查询工作正常,但是,要使其正常工作,我需要列出文件直接位于其下的目录.
I'm trying to using Microsoft's Log Parser to read multiple sets of IIS log files. Now, my query works fine, however, to get it to work properly, I need to have the directory listed that the files exist directly under.
我希望能够在高级目录下进行递归搜索.我已经找到了如何通过DLL来执行此操作,但是在命令提示符下找不到该方法.
I want to be able to do a recursive search under a high level directory. I have found how to do this thru the DLLs, but I can't find how with the command prompt.
必须对此有一个简单的解决方案,而我只是想念它.
There has to be a simple solution to this, and I'm just missing it.
推荐答案
在命令行中添加-recurse:-1
选项.使用以下命令检查输入格式的可用命令行选项:C:\>logparser -h -i:IIS
Add the -recurse:-1
option to the command-line. Check the available command-line options for your input format with: C:\>logparser -h -i:IIS
示例输出:
Input format: IIS (Microsoft IIS Log Format)
Parses Microsoft IIS log files
FROM syntax:
<filename> | <SiteID> [, <filename> | <SiteID> ... ]
<SiteID> = '<' SiteID '>'
SiteID can be a SiteID number, a fully qualified ADSI Path (e.g.
"//GABRIEGI1/W3SVC/1"), or a Site name (e.g. "My External Site"), eventually
containing wildcards
Parameters:
-locale <locale name> : 3-letter ID of the log file locale
[default value=DEF]
-returnExtraFields ON|OFF : Return additional fields in
Parameters field [default value=OFF]
-iCodepage <codepage ID> : Input codepage (-2=guess from
filename and/or LogInUTF8 property)
[default value=guess from filename
and/or LogInUTF8 property]
-recurse <level> : Max subdirectory recursion level
(0=no recurse, -1=all levels)
[default value=0]
-minDateMod <date> : Minimum file last modified date
[default value=not specified]
-iCheckpoint <checkpoint file> : Save checkpoint information to this
file [default value=no checkpoint]
Fields:
LogFilename (S) LogRow (I) UserIP (S) UserName (S)
Date (T) Time (T) ServiceInstance (S) HostName (S)
ServerIP (S) TimeTaken (I) BytesSent (I) BytesReceived (I)
StatusCode (I) Win32StatusCode (I) RequestType (S) Target (S)
Parameters (S)
这篇关于读取日志解析器递归文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!