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
0
votes
2 answers

Escape semicolon or comma in log parser 2.2

Can we escape semicolon (;) or comma (,) in log parser query? Because I want to query a file which is having ';' in file path. For example If I query a file which is placed under the folder named "ab;c" C:\Program Files (x86)\Log Parser…
user2173005
  • 45
  • 2
  • 5
0
votes
1 answer

Log Parser wrongly displays date '9999-12-31 00:00:00'

I am using log parser 2.2 to parse pipe deleimited file. I have one column with default date '9999-12-31 00:00:00'. Log parser displays this value as '-6385-12-31 00:00:00' Input File : Sample.txt Date|Name 9999-12-31 00:00:00|Tim Query :…
0
votes
1 answer

Pass a LogRecordSet into a method

I have a small command line app written in C# that uses LogParser and I was looking to clean it up a little because it is all in one massive method. I run my query and I get a LogRecordSet object: // run the query against wowza log LogRecordSet…
Hazza
  • 6,441
  • 3
  • 24
  • 37
0
votes
1 answer

Logparser, insert into sql table on iis 7

Through a windows service, I'm trying to insert the sc-bytes and the cs-bytes into a sql server. I'm able to do this via the command prompt windows but when I'm trying to add this in my windows service, it acts dead. I already tested the connection…
Dieter B
  • 1,142
  • 11
  • 20
0
votes
1 answer

LogParser and Event Logs

I am using following query to dump the event logs of a remote machine in a local database but execution time of this query is about 7-8 minutes. How can I reduce the execution time of the query. logparser -i:evt "select * from…
user3714811
  • 73
  • 1
  • 5
0
votes
3 answers

GROUP BY in sql to get monthly breakdown of data

Say I have a data that describes different items sold and when they were sold. I want to breakdown this data and count different items sold on monthly basis. So here is what I have so far: SELECT ItemDescription ,OrderReceivedData ,COUNT(*) AS…
Sahil Chaudhary
  • 493
  • 2
  • 10
  • 29
0
votes
2 answers

Using SQL to count data

Say I have this .csv file which holds data that describes sales of a product. Now say I want a monthly breakdown of number of sales. I mean I wanna see how many orders were received in JAN2005, FEB2005...JAN2008, FEB2008...NOV2012, DEC2012. Now one…
Sahil Chaudhary
  • 493
  • 2
  • 10
  • 29
0
votes
1 answer

Adding an extra column to log parser results

How to add an extra column with a specified value to log parser results? Thanks in advance!
user3714811
  • 73
  • 1
  • 5
0
votes
0 answers

logparser SELECT clause: Syntax Error: unknown field 'DateTime'

I have a problem. I created a Log Parser SQL Query that needs to retrieve Resultsets from .LOG file that has no Column Header. I used ParseIT Version 3.0. The problem there is Token inside the source file that I query called DateTime, but when I try…
0
votes
1 answer

how to use logparer for page stats

Does anyone have a script for logparser that will output a graph for daily page visits?
user281674
  • 433
  • 1
  • 4
  • 6
0
votes
1 answer

How to avoid logparser from storing input file name in each row?

I'm parsing a log file (IIS file) using logparser and works great but when I open generated file (csv) its first column is logfile name e.g. c:\temp\in_290414.log which is the input file. How can I avoid it? Thanks.
amit kohan
  • 1,612
  • 2
  • 25
  • 47
0
votes
1 answer

Compare 2 times ignoring the seconds

I'm using logparser to retrieve data from my IIS logs. #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken 2014-02-12 22:51:18 127.0.0.1 GET…
Cornwell
  • 3,304
  • 7
  • 51
  • 84
0
votes
1 answer

How to extract Data from text log file to specific columns in CSV - LogParser preferred

Hi I have a large log file the data is in following format : 125856 status-created 856598745 2000 125857 status-created 857598745 500 125858 status-created 856658745 3500 I need to export this data to separate columns in CSV file. Can you…
Abilash A
  • 951
  • 2
  • 8
  • 14
0
votes
1 answer

Log Parser HTML Reports

I’m not for sure if this is possible with Log Parser, but I’m trying to create an HTML report to include multiple IIS statistics. I don’t have any issues creating a report with just a single Log Parser query, but I want to be able to include…
user2441508
  • 13
  • 1
  • 5
0
votes
1 answer

Logparser - remove file extension

The below logparser query is returning the file names accessed from a website. LogParser.exe -i:W3C "SELECT EXTRACT_FILENAME (cs-uri-stem) As FileName FROM c:\weblog\file1.log" -o:CSV Example returned: forum.aspx example_image.jpg search.aspx Can…
Bondo
  • 93
  • 4
  • 8