logparser使用_使用LogParser 2.2解析我的IIS日志文件,以从NewsGator和NewsGatorOnline了解有关Blog统计信息的更多信息...

本文介绍了如何使用LogParser 2.2工具解析IIS日志文件,特别是关注NewsGator和NewsGatorOnline的订阅者统计数据。LogParser提供对文本数据的广泛查询访问,如日志文件,并具有可编程性。作者通过几个简单的查询展示了如何快速获取NewsGatorOnline的访问次数和不同订阅者数量。
摘要由CSDN通过智能技术生成
logparser使用

logparser使用

LogParser is pretty slick. It's wicked hard to learn, in my opinion as I'm not very SQL-y, but it's still awesome. Here's the marketecture description:

LogParser非常漂亮。 我认为这很难学,因为我不是SQL-y,但它仍然很棒。 这是市场描述:

Log parser is a powerful, versatile tool that provides universal query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows® operating system such as the Event Log, the Registry, the file system, and Active Directory.

日志解析器是功能强大的多功能工具,它可以对基于文本的数据(例如日志文件,XML文件和CSV文件)以及Windows®操作系统上的关键数据源(例如事件日志,注册表,文件系统和Active Directory。

There's a unofficial support site at LogParser.com which makes me respect the tools usefulness even more. Not even unsupported Microsoft tool has it's own unsupported support site supported by MikeG.

LogParser.com上有一个非正式的支持网​​站,这使我更加尊重工具的实用性。 甚至没有不受支持的Microsoft工具还拥有MikeG支持的它自己的不受支持的支持站点。

It's not only cool because it's a super-psycho command-line tool, and we all know how I love those. But, it's also got a COM Interface so it programmable/scriptable as well.

它不仅很酷,因为它是一种超级心理命令行工具,而且我们都知道我如何爱这些。 但是,它也有一个COM接口,因此它也是可编程/可编写脚本的

So, long story short, I noticed recently that GregR over at NewsGator said that he's including subscriber statistics in the NewsGatorOnline User-Agent. Now, I'm not sure what I think of tunnelling information like that in such an odd place, but what do I know? The idea is clever as hell.

因此,长话短说,我最近注意到, NewsGator的GregR表示,他在NewsGatorOnline User-Agent中包括了订户统计信息。 现在,我不确定在如此奇怪的地方如何传输类似的信息,但是我知道些什么呢? 这个主意很聪明。

I decided this was a good time to learn how to use LogParser. I grabbed a 20-Meg IIS log file from my ISP from a random day last week and setup some queries. Here's what I did in about 5 minutes.

我认为这是学习LogParser的好时机。 上周的随机一天,我从ISP处获取了一个20兆的IIS日志文件,并设置了一些查询。 这是我在大约5分钟内所做的事情。

C:\Program Files\Log Parser 2.2>LogParser.exe -i:IISW3C "SELECT COUNT(cs(User-Agent)) AS Client FROM c:\temp\ex050120.log WHERE cs(User-Agent) LIKE 'NewsGatorOnline%' "
Client
------
134

C:\ Program Files \ Log Parser 2.2> LogParser.exe -i:IISW3C“ SELECT COUNT( cs(User-Agent) ) AS Client from c:\ temp \ ex050120.log WHERE cs(User-Agent)就像'NewsGatorOnline% ” 客户------ 134

Statistics:
-----------
Elements processed: 90386
Elements output:    1
Execution time:     3.71 seconds

统计: ----------- 处理的元素:90386 元素输出:1 执行时间:3.71秒

So, if I'm understanding this correctly, NewsGatorOnline's Aggregator hit me 134 times this particular day. What's my number of NewsGatorOnline Subscribers?

因此,如果我正确理解这一点,那么在这一天,NewsGatorOnline的Aggregator打了我134次。 我的NewsGatorOnline订户数量是多少?

C:\Program Files\Log Parser 2.2
>LogParser.exe -i:IISW3C "SELECT DISTINCT cs(User-Agent) AS Client FROM c:\temp\ex050120.log WHERE cs(User-Agent) LIKE 'NewsGatorOnline%' "
Client
---------------------------------------------------------------
NewsGatorOnline/2.0+(
http://www.newsgator.com;+2+subscribers)
NewsGatorOnline/2.0+(
http://www.newsgator.com;+1+subscribers)
NewsGatorOnline/2.0+(
http://www.newsgator.com;+250+subscribers)
NewsGatorOnline/2.0+(
http://www.newsgator.com;+15+subscribers)
NewsGatorOnline/2.0+(
http://www.newsgator.com;+249+subscribers)

C:\ Program Files \ Log Parser 2.2 > LogParser.exe -i:IISW3C “SELECT DISTINCT CS(用户代理)AS客户端从C:\ TEMP \ ex050120.log WHERE CS(用户代理)LIKE 'NewsGatorOnline%'” 客户-------------------------------------------------- ------------- NewsGatorOnline / 2.0 +( http://www.newsgator.com; + 2 + subscribers ) NewsGatorOnline / 2.0 +( http://www.newsgator.com; + 1 + subscribers ) NewsGatorOnline / 2.0 +( http://www.newsgator.com; + 250 + subscribers ) NewsGatorOnline / 2.0 +( http://www.newsgator.com; + 15 + subscribers ) NewsGatorOnline / 2.0 +( http://www.newsgator.com; + 249 + subscribers )

Statistics:
-----------
Elements processed: 90386
Elements output:    5
Execution time:     3.67 seconds

统计: ----------- 处理的元素:90386 元素输出:5 执行时间:3.67秒

Now, I don't know if I'm doing this right, but I'm not sure what I'm being told here. Either I'm doing this query wrong or Greg's stats are off. I'd expect the number of subscribers to be constant or change +/- a few a day.

现在,我不知道我是否做得正确,但是我不确定在这里告诉我什么。 我做错了这个查询,或者Greg的统计信息都关闭了。 我希望订户的数量保持不变或每天变化+/-几天。

UPDATE: I realized this on the way home and GregR emailed me to remind me, each distinct RSS Url is tracked by NewsGator. So my ATOM Feed and my Category Specific Feeds each have their own statistics.

更新:我在回家的路上意识到了这一点,GregR通过电子邮件发送给我提醒我,NewsGator会跟踪每个不同的RSS网址。 因此,我的ATOM Feed和我的特定类别Feed都有各自的统计信息。

This is just NewsGatorOnline folks. I also run queries on actual NewsGator Add-In users for both version 1.0 and 2.0. (I'm sure there's a way to do it all in one query, but again I'm not SQL-y.

这只是NewsGatorOnline的人。 我还在版本1.0和2.0的实际NewsGator加载项用户上运行查询。 (我敢肯定有一种方法可以在一个查询中完成所有操作,但是我又不是SQL-y。

C:\Program Files\Log Parser 2.2>LogParser.exe -i:IISW3C "SELECT DISTINCT COUNT(c-ip) AS Client FROM c:\temp\ex050120.log WHERE cs(User-Agent) LIKE 'NewsGator/1%' "
Client
------
25

C:\ Program Files \ Log Parser 2.2> LogParser.exe -i:IISW3C“从c:\ temp \ ex050120.log中选择不同的计数(c-ip)AS客户端,其中cs(User-Agent)就像'NewsGator / 1% ” 客户------ 25

C:\Program Files\Log Parser 2.2>LogParser.exe -i:IISW3C "SELECT DISTINCT COUNT(c-ip) AS Client FROM c:\temp\ex050120.log WHERE cs(User-Agent) LIKE 'NewsGator/2%' "
Client
------
4874

C:\ Program Files \ Log Parser 2.2> LogParser.exe -i:IISW3C“从c:\ temp \ ex050120.log中选择不同的计数(c-ip)AS客户端,其中cs(User-Agent)就像'NewsGator / 2% ” 客户------ 4874

I thought this means I have around 25 distinct IPs using NewsGator 1.x who hit my site that day and about 4874 using NewsGator 2.0. But, that seems like WAY too many people subscribed to my site with just NewsGator. So, I changed the query:

认为这意味着当天使用NewsGator 1.x的网站大约有25个不同的IP,而使用NewsGator 2.0的网站大约有4874个。 但是,这似乎是太多的人订阅了我的网站只的NewsGator。 因此,我更改了查询:

C:\Program Files\Log Parser 2.2>LogParser.exe -i:IISW3C "SELECT COUNT(DISTINCT c-ip) AS Client FROM c:\temp\ex050120.log WHERE cs(User-Agent) LIKE 'NewsGator/2%' "
Client
------
385

C:\ Program Files \ Log Parser 2.2> LogParser.exe -i:IISW3C“从c:\ temp \ ex050120.log中选择COUNT(DISTINCT c-ip) AS客户端,其中cs(User-Agent)就像'NewsGator / 2% ” 客户------ 385

THAT'S more like it. 385 distinct IPs using NewsGator 2.x hit my site this particular day. As an aside, there are actually 2 people using NewsGator 1.x. Cool. I need to spend more time understanding this tool. I believe I can ask it more complicated questions about my site than something like LiveStats, and I could set it up to email me charts or stats, or create an ASPX page for blog-specific reports.

这还差不多。 在这一天,使用NewsGator 2.x的385个不同IP登陆了我的网站。 顺便说一句,实际上有2个人使用NewsGator1.x。 凉。 我需要花更多的时间来了解这个工具。 我相信,与LiveStats之类的问题相比,我可以向它询问有关我的网站的更复杂的问题,并且可以将其设置为向我发送图表或统计信息,或者为特定博客的报告创建ASPX页。

翻译自: https://www.hanselman.com/blog/parsing-my-iis-log-files-with-logparser-22-to-learn-more-about-blogs-stats-from-newsgator-and-newsgatoronline

logparser使用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值