All Projects → peschuster → Logmonitor

peschuster / Logmonitor

Licence: mit
Monitoring log files on windows systems.

Projects that are alternatives of or similar to Logmonitor

Graylog Plugin Metrics Reporter
Graylog Metrics Reporter Plugins
Stars: ✭ 71 (+208.7%)
Mutual labels:  monitoring, metrics, graphite, statsd
Icingaweb2 Module Grafana
Grafana module for Icinga Web 2 (supports InfluxDB & Graphite)
Stars: ✭ 190 (+726.09%)
Mutual labels:  monitoring, metrics, graphite
Appmetrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application.
Stars: ✭ 1,986 (+8534.78%)
Mutual labels:  monitoring, metrics, graphite
Mtail
extract internal monitoring data from application logs for collection in a timeseries database
Stars: ✭ 3,028 (+13065.22%)
Mutual labels:  monitoring, metrics, logs
Graylog Plugin Metrics
Graylog output plugin for Graphite and Ganglia
Stars: ✭ 16 (-30.43%)
Mutual labels:  monitoring, metrics, graphite
Icinga2
Icinga is a monitoring system which checks the availability of your network resources, notifies users of outages, and generates performance data for reporting.
Stars: ✭ 1,670 (+7160.87%)
Mutual labels:  monitoring, metrics, graphite
Graphite exporter
Server that accepts metrics via the Graphite protocol and exports them as Prometheus metrics
Stars: ✭ 217 (+843.48%)
Mutual labels:  monitoring, metrics, graphite
Es Stats
ElasticSearch cluster metrics -> Graphite
Stars: ✭ 91 (+295.65%)
Mutual labels:  monitoring, metrics, graphite
gateway
A proxy to buffer and forward metrics, events, and traces.
Stars: ✭ 94 (+308.7%)
Mutual labels:  metrics, daemon, graphite
Statsd
Daemon for easy but powerful stats aggregation
Stars: ✭ 16,179 (+70243.48%)
Mutual labels:  metrics, graphite, statsd
Opstrace
Secure observability, deployed in your own network. An open source alternative to SaaS solutions like Datadog, SignalFx, ...
Stars: ✭ 743 (+3130.43%)
Mutual labels:  monitoring, metrics, logs
Metrictank
metrics2.0 based, multi-tenant timeseries store for Graphite and friends.
Stars: ✭ 574 (+2395.65%)
Mutual labels:  monitoring, metrics, graphite
Polymur
A fast carbon-relay with live routing controls + https Graphite forwarder
Stars: ✭ 97 (+321.74%)
Mutual labels:  monitoring, metrics, graphite
Statsd Vis
Standalone StatsD server with built-in visualization
Stars: ✭ 124 (+439.13%)
Mutual labels:  monitoring, metrics, statsd
Amon
Amon is a modern server monitoring platform.
Stars: ✭ 1,331 (+5686.96%)
Mutual labels:  monitoring, metrics, statsd
Kenshin
Kenshin: A time-series database alternative to Graphite Whisper with 40x improvement in IOPS
Stars: ✭ 203 (+782.61%)
Mutual labels:  monitoring, metrics, graphite
Cernan
telemetry aggregation and shipping, last up the ladder
Stars: ✭ 306 (+1230.43%)
Mutual labels:  metrics, graphite, statsd
Influxgraph
Graphite InfluxDB backend. InfluxDB storage finder / plugin for Graphite API.
Stars: ✭ 87 (+278.26%)
Mutual labels:  monitoring, metrics, graphite
Homer App
HOMER 7.x Front-End and API Server
Stars: ✭ 88 (+282.61%)
Mutual labels:  monitoring, metrics, logs
Netdata
Real-time performance monitoring, done right! https://www.netdata.cloud
Stars: ✭ 57,056 (+247969.57%)
Mutual labels:  monitoring, graphite, statsd

LogMonitor

LogMonitor is a combination of logtail and logster, but specifically designed for windows systems. It watches directories or files for changes, extracts metrics from the added content and submits these metrics to a configured backend (graphite, statsd or console).

Extracting metrics from added content is done by PowerShell scripts, which can be created or customized at will.

Documentation

Architecture of LogMonitor

LogMonitor consists of three components:

  1. Watching files or directories for changes.
  2. Parsing added content.
  3. Submitting metrics to backends.

Every component can be configured seperately and plugged together at will. Therefore you could e.g. watch two directories for changes, process all changes through the same parsers, but submit changes of the directories to seperat backends. Mapping between the components is always performed by regular expressions on the file names of the read changes.

Running LogMonitor

LogMonitor can run in a console window (simply start LogMonitor.exe) or as a windows service.

To install LogMonitor as a Windows Service execute the following command:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe LogMonitor.exe

And start the LogMonitor service with the command

net start LogMonitor

Configuration

Configuration is done completely through the App.config (i.e. LogMonitor.config) file. An example is available at source/LogMonitor/App.config

Add the configuration section to your app.config file:

<configSections>
  <section name="logMonitor" type="LogMonitor.Configuration.LogMonitorConfiguration, LogMonitor"/>
</configSections>

Watched directories

<watch>
  <add path="C:\inetpub\logs\LogFiles\W3SVC1" type="w3c" filter="*.log" maxDaysInactive="2" />
</watch>

Options:

  • path - Path to a directory or file.
  • filter - [optional], default: "*". Filter for watched files in directory.
  • type - [optional], if w3c all lines are split in respective fields. Powershell scripts are provided with an W3CChange object.
  • maxDaysInactive - [optional], default: -1. If set, only files with activity during the last x days (configured value) are watched for changes.
  • bufferTime - [optional], default: 500. Time (in ms) for which events by the file system are buffered (i.e. aggregated) before processing.
  • intervalTime - [optional], default: 5000. Interval (in ms) of manual checks for changed files (in case file system raised no events).

Parser for metrics

<parser>
  <add scriptPath=".\Scripts\CallCountProcessor.ps1" pattern="\.log$" />
  <add scriptPath=".\Scripts\TimeTakenProcessor.ps1" pattern="\.log$" />
  <add scriptPath=".\Scripts\HttpStatusProcessor.ps1" pattern="\.log$" />
</parser>

Options:

  • scriptPath - Path to PowerShell script.
  • pattern - RegEx pattern applied to log file names, to map parsers to specific files, file types or locations.

Output backends

<output>
  <add pathPattern="w3SVC7" type="." target="statsd" metricsPrefix="mysite1" />
  <add pathPattern="w3SVC6" type="." target="statsd" metricsPrefix="mysite2" />
  <add pathPattern="w3SVC5" type="." target="statsd" metricsPrefix="mysite3" />
</output>

Options:

  • pathPattern - RegEx pattern applied to log file names, to map output backends to specific files, file types or locations.
  • type - RegEx pattern to filter metrics by type.
  • target - Name of the backend (graphite, statsd or console).
  • metricsPrefix - Prefix applied to all metrics, before sending them to the backend.

Additional configuration

The graphite and statsd backends need extra configuration:

<configSections>
  <section name="graphite" type="Graphite.Configuration.GraphiteConfiguration, Graphite" />
</configSections>
<graphite xmlns="http://github.com/peschuster/Graphite/Configuration">
  <graphite address="127.0.0.1" port="2003" transport="Tcp" />
  <statsd address="127.0.0.1" port="8125" prefixKey="test" />
</graphite>

LogMonitor uses the graphite base library for these backends: Graphite

To see/store log messages you can simply add a trace listener in your configuration:

<system.diagnostics>
  <trace autoflush="true" indentsize="4">
    <listeners>
      <add name="configConsoleListener" type="System.Diagnostics.ConsoleTraceListener" />
    </listeners>
  </trace>
</system.diagnostics>

Writing PowerShell script parsers

A PowerShell script for extracting metrics from added lines must always contain a function with the following signature:

Function MetricProcessor ([LogMonitor.FileChange] $change)
{
}

It also must always return a list of LogMonitor.Metric objects. Objects of this type can be created by calling [LogMonitor.Metric]::Create(..).

Here is an example for simply returning the number of added lines:

$metrics = @()
    
if ($change.GetType().FullName -eq "LogMonitor.Processors.W3CChange")
{
	$metrics += [LogMonitor.Metric]::Create('calls', $change.Values.Count, [LogMonitor.MetricType]::Counter)
}
    
return $metrics

This example also checks for the type LogMonitor.Processors.W3CChange which is passed to the PowerShell script for log files of type w3c.

Planned features

  • Command line interface for reading historical data.

Build

How to build LogMonitor:

  1. Go to \build\ directory
  2. Execute go.bat
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].