Help Center

This article authored by "Friedrich Software Resources", an Urchin Software Authorized Consultant.

Custom Date/Time Formats

Introduction

Urchin can process virtually any date or time format contained in a log file. The only requirement is to provide Urchin with the necessary date or time format which matches the pattern of the date contained in the log file. This article describes the variables used to specify the date or time format. These formats are specified inside a custom log format file. Please see the "Custom Log Formats" article above in this section.

How Date/Time Parsing Works

Urchin determines the date/time by comparing a specified format against the date/time field(s) in the log file.

For example, an IIS log contains the date in the following form: 2002-11-12 Urchin is able to determine the year, month, and day be using the following format: %Y-%m-%d

Creating A Date/Time Format

To create a custom date/time format, first look at the order and pattern of the date/time data contained in your log file. Then, select from the following Date/Time variables listed below to make up the format. Time zones around the world are expressed as positive and negative offsets of UTC (coordinated universal time).

For example, if your log file contains the time as "07:01:47", then you need to create a pattern to match this. The first thing to note is that the pattern is hours:minutes:seconds. Looking at the variable list below, you will note that %H is the variable for hours, %M is the variable for minutes, and %S is the varialble for seconds. Putting these together yields a format of "%H:%M:%S". If you have a literal '%' character in the date or time format field, you can specify the literal % as %%.

The most common variables are: %Y, %m, %d, %H, %M, and %S.

Date/Time Variable Definitions