Questions tagged [logparser]

A log parser extracts (usually text) data from a log file into a more specific data structure, making the log information easier to process. A log parser can be implemented as a standalone application, or as a library for a specific programming language. LogParser is also the name of a free Microsoft tool which provides a SQL-like interface to log files of almost any format, from generic CSV, TSV, and XML files to more specific formats.

Many server-side applications create log files, usually in a more-or-less structured text format.

While this allows for maximum flexibility in accessing these logs with a wide variety of tools, it makes programmatic processing a bit of a pain, especially when no concise format specification is available for the logs.

This is where a log parser comes in: it is either a standalone application or a library designed for one or sometimes multiple programming languages, and converts the log file into more specific data structures, such rows in an Excel sheet or class instances.

The newly created data structures contain field names and are type-safe as much as possible, making further processing much easier.

296 questions
3
votes
3 answers

Using regular expression to extract a word...if it exists

I want to use RE to parse a log file and return the orderid if it exists. For example: Here is a sample log 2012-07-19 12:05:04,288 [22] INFO AddQueueCommand [(null)] - Status set to Subscribed 2012-07-19 12:05:04,288 [23] INFO …
dan27
  • 1,425
  • 3
  • 14
  • 13
2
votes
0 answers

How to speed up a LogParser application in ASP.NET

I've developed an ASP.NET application that receives input from the user which is basically an SQL query ran by LogParser. (This input is kept in the "sql1" string. It works, but works slowly. For a log file of 60 MB, I've even received an…
Slethron
  • 143
  • 1
  • 4
  • 11
2
votes
1 answer

LogParser and multiple query string arguments with the same name

I'm trying to get IIS logs statistics with LogParser, and I have to group numbers by the values that a certain argument, named 't', can assume on the query string. We have to handle scenarios like this one: .../?t=act&t=fcst&t=be where the same…
Wasp
  • 3,395
  • 19
  • 37
2
votes
1 answer

Log parser not treating "" as one field

Im trying to parse an IIS log file using LogParser 2.2, however im having a problem when it comes to the user agent because it sees the spaces in the following user agent and thinks it's a new field... "Mozilla/5.0 (Windows NT 6.1; WOW64)…
electricsheep
  • 5,114
  • 9
  • 37
  • 41
2
votes
1 answer

Using Microsoft Log Parser, how would you do Hit count aggregates with IP counts?

I'm using MS Log Parser to do simple analytics against IIS logs. I want a query that generates a report indicating the count of unique IPs hitting URLs, resulting in something like: URL | Unique_IPs | Total_Views url1 3 100 url2 5 …
marc esher
  • 4,871
  • 3
  • 36
  • 51
2
votes
2 answers

Trying to write a program / library like LogParser - How does it work internally?

LogParser isn't open source and I need this functionality for an open source project I'm working on. I'd like to write a library that allows me to query huge (mostly IIS) log files, preferably with Linq. Do you have any links that could help me? How…
kitsune
  • 11,516
  • 13
  • 57
  • 78
2
votes
1 answer

How to correctly parse lambda's log in Logs Insights

i have this type of log in @message: 2022-06-16T10:35:12.921Z 8984a0e4-0ff0-4cfd-ac5a-a312ec3f6157 DEBUG successfully retrieved 15758 object How can i parse this log to have different columns with: timestamp (2022-06-16T10:35:12.921Z), requestID…
2
votes
1 answer

LogParser get results from last hour

I have cpu monitors constantly workning on my computer. I would like log parser to parse results only from the last hour. does anyone know how to do that? SELECT TO_STRING(QUANTIZE(TO_TIMESTAMP(Field1, 'mm/dd/yyyy HH:mm:ss.ll'),10 ), 'hh:mm:ss') AS…
pall
  • 123
  • 1
  • 3
  • 6
2
votes
1 answer

Powershell/Logparsing Casting Data Type

I also posted this on the powershell usenet groups, but I think it is mostly dead now. I am in over my head working on a script. Working with both powershell and log parser. I am currently trying to take csv input and output into a accdb. I have a…
Ty.
  • 187
  • 1
  • 2
  • 13
2
votes
1 answer

LogParser in C# Job

I have written one job in c# to read through iislogs and push the data to DB. We are reading the logs incrementally but we ran into performance issue. Our log files had more than 300k of lines and job kept on running. I installed Log parser and we…
2
votes
2 answers

LogParser: SQL table column "X" data type is not compatible with SELECT clause item "cs-username" (type STRING)

I'm trying to use LogParser to insert relevant rows from IIS logfiles into a SQL-Server table. I created my table as follows: CREATE TABLE dbo.WebLog (Id INT IDENTITY, UserName VARCHAR(MAX), URL VARCHAR(MAX), DateStampUTC DATETIME) This is how…
Skrealin
  • 1,114
  • 6
  • 16
  • 32
2
votes
2 answers

Select top 10 pages with log parser from iis logs

Hi Could you please let me know query to select top 10 pages from every iis log files using logparser. Thanks,
rmdussa
  • 1,549
  • 10
  • 27
  • 50
2
votes
1 answer

IIS Log Parser - Need Query to find "total requests taking > x secs" / "Total Requests" grouped by URL

I am supporting an application that is having occasional performance issues. The client wants to know how often a page is slow. i.e. Total times a page took greater than x secs / Total number of requests for the page I would like to write a single…
MrX
  • 21
  • 1
  • 2
2
votes
1 answer

Trouble parsing through a lot of logs using wildcards

I want to create a script that will wrap logparser into Powershell and automatically analyze a set of logs. I will create a function for a lot of common analysis tasks. The issue I am having is I have a separate copy script that will go to a lot of…
Kenny
  • 74
  • 7
2
votes
1 answer

How to query IIS web logs from T-SQL directly

I learned how to do basic queries of the IIS web log with LogParser Studio and to export the LogParser query into a PowerShell script, which is great because I can have the Windows Task Scheduler run the script on a schedule. However, I was…
user4864716
1 2
3
19 20