System.ApplicationLog.GenericLog.EventProvider

Applies To: Operations Manager 2007 R2

The System.ApplicationLog.GenericLog.EventProvider data source module type is used to provide entry data from a directory that contains non-delimited text-based generic log files. This module returns each generic log file’s entry data as System.Event.Data data.

Usage

Use the module to provide generic log entry data within event data from within a workflow. A standard generic log file is a file that contains only one non-delimited string per log entry. If your log file includes delimited text within each entry, use the System.ApplicationLog.GenericCSVLog.EventProvider module type.

Type Definition

<DataSourceModuleType ID="System.ApplicationLog.GenericLog.EventProvider" Accessibility="Public" Batching="false">
  <Configuration>
    <xsd:element name="LogFileDirectory" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="LogFilePattern" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="LogIsUTF8" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
  </Configuration>
  <ModuleImplementation Isolation="Any">
    <Composite>
      <MemberModules>
        <DataSource ID="DataSource" TypeID="System.ApplicationLog.GenericLogReader">
          <LogFileDirectory>$Config/LogFileDirectory$</LogFileDirectory>
          <LogFilePattern>$Config/LogFilePattern$</LogFilePattern>
          <LogIsUTF8>$Config/LogIsUTF8$</LogIsUTF8>
        </DataSource>
        <ConditionDetection ID="Mapper" TypeID="System!System.Event.GenericDataMapper">
          <EventOriginId>$Target/Id$</EventOriginId>
          <PublisherId>$MPElement$</PublisherId>
          <PublisherName>GenericLog</PublisherName>
          <Channel>GenericLog</Channel>
          <LoggingComputer />
          <EventNumber>0</EventNumber>
          <EventCategory>3</EventCategory>
          <EventLevel>0</EventLevel>
          <UserName />
          <Params>
            <Param>$Data/Params/Param[1]$</Param>
          </Params>
        </ConditionDetection>
      </MemberModules>
      <Composition>
        <Node ID="Mapper">
          <Node ID="DataSource" />
        </Node>
      </Composition>
    </Composite>
  </ModuleImplementation>
  <OutputType>System!System.Event.Data</OutputType>
</DataSourceModuleType>

Parameters

The System.ApplicationLog.GenericLog.EventProvider module supports the configuration parameters described in the following table.

Parameter Type Overrideable Description

LogFileDirectory

String

False

Required parameter. Contains the full path to the local directory from which to read the log file or files.

LogFilePattern

String

False

Required parameter. Contains the file name or wildcard pattern to match for the log files.

LogIsUTF8

Boolean

False

Required parameter. Indicates whether the log file is UTF8-encoded. The value should be either true or false.

For more information about all of the parameters in this module, see System.ApplicationLog.GenericLogReader.

Remarks

For remarks, see System.ApplicationLog.GenericLogReader.

Composition

The System.ApplicationLog.GenericLog.EventProvider module is a composite module that contains the member modules described in the following table.

Workflow Run Order Module Type Usage

1

System.ApplicationLog.GenericLogReader

Reads the non-delimited, text-based log entries.

2

System.Event.GenericDataMapper

Maps the generic log entry data to event data.

Module Type Usage

System.ApplicationLog.GenericCSVLog.EventProvider

Maps delimited, text-based generic log entry data to event data. Returns System.Event.Data data.

System.ApplicationLog.GenericCSVLogReader

Maps filtered delimited, text-based generic log entry data to event data. Returns System.Event.Data data.

System.ApplicationLog.GenericLog.FilteredEventProvider

Maps filtered non-delimited, text-based generic log entry data to event data. Returns System.Event.Data data.

External Module References

None.

Sample

The following sample illustrates how a rule can be implemented to retrieve generic log entry data from any number of log files in a directory. After the module maps the log entry data to event data, the data is returned and written to the Operations Manager database and data warehouse.

<Rule ID="Microsoft.Samples.LogEntryToEvent" Target="Microsoft.Samples.TheApplication" Enabled="true">
 <DataSources>
    <DataSource ID="LogDS" TypeID="AppLog!System.ApplicationLog.GenericLogReader">
      <LogFileDirectory>C:\Logs</LogFileDirectory>
      <LogFilePattern>*.log</LogFilePattern>
      <LogIsUTF8>false</LogIsUTF8>
    </DataSource>
  </DataSources>
  <WriteActions>
    <WriteAction ID="WriteToDB" TypeID="SCLibrary!Microsoft.SystemCenter.CollectEvent"/>
    <WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishEventData"/>
  </WriteActions>

</Rule>

If the log entry line is This is a single log entry., the output of the System.ApplicationLog.GenericLog.EventProvider module would be something like the following:

<DataItem type="System.Event.Data" time="2008-03-11T03:08:55.0343534-08:00" sourceHealthServiceId="0A0800A0-A802-E90B-6045-D961D516CA78">
  <EventOriginId>513C3E6D-374A-47d1-94B6-920EB54F9A27</EventOriginId>
  <PublisherId>513C3E6D-374A-47d1-94B6-920EB54F9A27</PublisherId>
  <PublisherName>GenericLog</PublisherName>
  <Channel>GenericLog</Channel>
  <LoggingComputer />
  <EventNumber>0</EventNumber>
  <EventCategory>3</EventCategory>
  <EventLevel>0</EventLevel>
  <UserName />
  <EventData>
    <DataItem type="System.ApplicationLog.GenericLogEntryData" time="2007-05-22T10:07:41.6416394-07:00" sourceHealthServiceId="A9BB62D3-BEF2-5208-E680-1EE489235408">
      <LogFileDirectory>c:\Logs</LogFileDirectory>
      <LogFileType>Generic Log File Format</LogFileType>
      <LogFileName>c:\Logs\some.log</LogFileName>
      <Params>
        <Param>This is a single log entry.</Param>
        </Params>
      <DataItem>
  </EventData>
</DataItem>

Information

   

Module Type

DataSourceModuleType

Input Type

None

Output Type

System.Event.Data

Implementation

Composite

Library

System.ApplicationLog.Library