27
LogParser Quicker than SSIS, easier than BCP @fatherjack / [email protected]

LogParser Quicker than SSIS, easier than BCP @fatherjack / [email protected]

Embed Size (px)

Citation preview

Page 1: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

LogParser

Quicker than SSIS, easier than BCP

@fatherjack / [email protected]

Page 2: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Who on Earth is Jonathan Allen?

Twitter.com/fatherjackTwitter.com/fatherjack

Page 3: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Who on Earth is Jonathan Allen? Local Government 13 years – accountancy/tax collection.

Systems engineer and DBA since 1999

SQL Server 6.5, 7, 2000, 2005 and 2008

Blog, Twitter, PASS Chapter leader - SQL South West

PASS UK Regional Mentor

Page 4: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

LogParser in 60 minutes

• Download• Interface• Syntax• Some examples of LogParser in use• Common problems and how to deal with them• Help + support

Page 5: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Download

• Tiny application - 1Mb download!• From … http://

www.microsoft.com/download/en/details.aspx?displaylang=en&id=24659

http://j.mp/nCxRuP

Page 6: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

LogParser environment

• Command line interface

• SQL like syntax to select data

• Some simple parameters to control output

• Only 4 data types – INT, STRING, REAL, TIMESTAMP

Page 7: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Jonathan Allen © - May 2011

Data types

• INT (64 bit)-2^63 through 2^63-1

• String

• Real±5.0*10-324 through ±1.7*10308

• Timestamp

• TinyInt, SmallInt, Int, BigInt

• VarChar

• Decimal/Float/Money

• Date/Time/DateTime

LogParser data type SQL Server data type

Page 8: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Help and support

• Great Help chm file included

• Good support on http://www.iis.net forum

Page 9: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Jonathan Allen © - May 2011

The Ins and Outs of LogParser

• ADS

• BIN

• COM

• CSV

• ETW

• EVT

• FS

• HTTPERR

• IIS

• IISODBC

• IISW3C

• NCSA

• NETMON

• REG

• TEXTLINE

• TEXTWORD

• TSV

• URLSCAN

• W3C

• XML

• CHART

• CSV

• DATAGRID

• IIS

• NAT

• SQL

• SYSLOG

• TPL

• TSV

• W3C

• XML

Input formats Output formats

Page 10: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

LogParser modes

• Query Execution Mode (default)– Reads from Input and writes to Output

• Conversion Mode– Relates to working with W3C/IIS formats

• Defaults Override Mode– Used to change defaults to popular settings

• Help Mode– LOGPARSER -h

Page 11: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Common uses

• Rapid import of data from multiple files/sources/locations.

• Filtering, aggregation of data during import.

• Importing text data.• Monitoring of enterprise event logs.

Page 12: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Demo

Page 13: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

LogParser Security considerations

• Source data connections are vulnerable• If a checkpoint file is used make sure it is

secure to prevent undesirable results by using ACL on secure network location.

• Usernames, passwords and data are sent in plain text by default so should be used advisedly over a network. Consider using ODBC.

Page 14: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Tips and tricks #01

Both * and % are wildcards – be carefulUse –fixcolnamesUse –queryinfo to diagnose issuesUse –h to get help …

Page 15: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Tips and tricks #02

Help: -h GRAMMAR : SQL Language Grammar

-h FUNCTIONS [ <function> ] : Functions Syntax

-h EXAMPLES : Example queries and commands

-h -i:<input_format> : Help on <input_format>

-h -o:<output_format> : Help on <output_format>

-h -c : Conversion help

E.g. LogParser -h -evt or LogParser -h functions

Page 16: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

What now..?

• Next sessions Drinks and socialise

• Speak to exhibitors, if you haven't already.

• Speak to Community Corner about your local user group.

Page 17: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Jonathan Allen © - May 2011

Contact me• Blog – http://www.simple-talk.com/community/blogs/jonathanallen

• SQL forum moderator – http://ask.sqlservercentral.com

• Twitter - @Fatherjack

• SQLSouthWest PASS chapter – [email protected]

• Friend of Red Gate - http://www.red-gate.com

Page 18: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Europe’s Premier Community SQL Server Conference

Page 19: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Platinum Sponsor

Premium Sponsor

Page 20: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Please visit our Gold Sponsor stands,we couldn't do it without you…

Page 22: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Monday 3rd OctoberManchester - Manchester SQL Server User GroupBirmingham - SQL Midlands User Group Farnham - Surrey SQL Server User GroupAshford - Kent SQL Server and .NET User Group

Tuesday 4th OctoberLeeds - Leeds Area SQL Server User GroupLondon - London SQL Server User GroupBristol - SQL Server ClubHatfield - SQL Herts User GroupMaidenhead - Maidenhead SQL Server User Group

Wednesday 5th OctoberEdinburgh - Scottish Area SQL Server User GroupCardiff - Cardiff SQL Server User GroupExeter - SQL South West User GroupSouthampton - Southampton SQL Server User GroupCambridge - Cambridgeshire SQL Server User GroupBasildon - Essex SQL Server User Group

Thursday 6th OctoberLondon - UK SQL Server User Group

SQL Relay events

Page 23: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Another community days:

DDDNorth - Sunderland Saturday 8th October http://developerdeveloperdeveloper.com/north

DunDDD – Dundee Saturday 19th Novemberhttp://dundee.dddscotland.co.uk

Another slide Martin has slipped in without telling me!

Page 24: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Feedback

• Please complete your feedback and another chance to win the latest XBOX 360

• http://sqlbits.com/sqlbits9Thursday• http://sqlbits.com/sqlbits9Friday• http://sqlbits.com/sqlbits9Saturday• http://sqlbits.com/sqlbits9Feedback

Page 25: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

On Next…

• Prize giving in the Exhibition Area

#SQLBITS

Page 26: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

We hope you had a great conference!

Keep checking www.sqlbits.com for slide,

videos and news of the next conference

#SQLBITS

Page 27: LogParser Quicker than SSIS, easier than BCP @fatherjack / jonathan@sqlsouthwest.co.uk

Thank you for coming

#SQLBITS