|
- Edit Data Source
- Each Data Source has several configuration parameters:
- Name visible Data Source name
- Type one of the available data source types (File/ODBC/COM/TCP/UDP). Each type is explained in the details in the corresponding section
- Expression Regular Expression is used for extracting separate fields from source log line
- Data param is the string (depending on the data source type) indicating where log data is placed
- Log Duplicate path to local file caching parsed data source data. There are some data source types allowing no repeating data (COM/TCP/UDP). The caching file stores data history that could be re-played in the connected diagrams. Do not forget to set the filename. It will be used for data transfer between the data source and all the linked diagrams.
- Fields is field aliases (field names) which are appeared in all connected diagrams for the diagram management
- Source Monitor allows you to check the accuracy of data parsing expression and preview parsed results. Last 10 log lines is parsed in showed in the list pressing the Update button
- Expression Test button initially assists you compose the regular expression for the log parsing
- Browse/Connect button helps you to choose the correct data source log file (for File type logs) or to check the "connect string" describing the source location (for other data source types)
- Data Source composing
- The main aim of data source is to obtain raw data from log of available type and convert them to the set of named fields. As the result, a diagram works with the fields set. All the converting details are hiding by data source focusing you on the diagram statistic researches.
- Let us examine the sample of raw log data and corresponding regular expression with PBX log sample.
- 07/25/02 11:00AM 108 04 <INCOMING> 00:04'19
- It means that at 25 of July 2002 11:08 AM there was an incoming telephone call to internal number 108 continued 4 minutes and 19 seconds provided by external line 04.
We should write the regular expression parsing the string to the set of fields : - Date, Time, PhoneNumber, ExtLine, CallDirection, CallDuration
- Regular Expression (RegExp) supports so-called grouping. It is the mechanism extracting several substrings from single RegExp. Each group of a RegExp placed in bracket extracts the separate piece of examined string. If we compose the fields list in the same order (regexp's group order) we will extract the separate fields set from single log (data source)line.
- The RegExp
- ([0-9]+/[0-9]+/[0-9]+) *([0-9]+:[0-9]+)(A|P)M *([0-9]+) *([0-9]+) *([^ ]+)*([0-9]+:[0-9]+'[0-9]+)
- fulfills the action. The signs [0-9]+ mean any symbol between 0 and 9 (digit) repeated one or more times without any other symbols inside (Let us denote it as D for the simplification). The * means needed white spaces template in the source log string.
| part of source string | group in RegExp | Field name | | 07/25/02 | D/D/D | Date | | 11:00 | D:D | Time | | AM | (A|P)M | AM or PM | | 108 | D | PhoneNumber | | 04 | D | ExtLine | | <INCOMING> | [^ ]+ | CallDirection(any character except white space repeated more times) | | 00:04'19 | D:D'D | CallDuration |
|