Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
weblog IIS (#977)
Browse files Browse the repository at this point in the history
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
  • Loading branch information
thiagoftsm and ilyam8 committed Nov 9, 2022
1 parent ba33f91 commit 33edc13
Show file tree
Hide file tree
Showing 5 changed files with 311 additions and 3 deletions.
8 changes: 8 additions & 0 deletions config/go.d/web_log.conf
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,11 @@ jobs:

- name: gunicorn
path: /var/log/gunicorn/gunicorn-access.log

# IIS
# This configuration assumes you are running netdata on WSL
- name: iis
path: /mnt/c/inetpub/logs/LogFiles/W3SVC1/u_ex*.log
log_type: csv
csv_config:
format: '- - $host $request_method $request_uri - $server_port - $remote_addr - - $status - - $request_time'
12 changes: 9 additions & 3 deletions modules/weblog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: "Web server log (Apache, NGINX) monitoring with Netdata"
description: "Monitor the health and performance of Apache or Nginx logs with zero configuration, per-second metric granularity, and interactive visualizations."
custom_edit_url: https://github.com/netdata/go.d.plugin/edit/master/modules/weblog/README.md
sidebar_label: "Web server logs (Apache, NGINX)"
sidebar_label: "Web server logs (Apache, NGINX, Microsoft IIS)"
-->

# Web log (Apache, NGINX) monitoring with Netdata
# Web log (Apache, NGINX, IIS) monitoring with Netdata

This module parses [`Apache`](https://httpd.apache.org/) and [`NGINX`](https://nginx.org/en/) web servers logs.
This module parses [`Apache`](https://httpd.apache.org/), [`NGINX`](https://nginx.org/en/) and [Microsoft IIS](https://www.iis.net/) web servers logs.

## Metrics

Expand Down Expand Up @@ -316,6 +316,12 @@ jobs:
log_type: csv
csv_config:
format: '- - %h - - %t \"%r\" %>s %b'

- name: iis
path: /mnt/c/inetpub/logs/LogFiles/W3SVC1/u_ex*.log
log_type: csv
csv_config:
format: '- - $host $request_method $request_uri - $server_port - $remote_addr - - $status - - $request_time'
```

For all available options, please see the
Expand Down
2 changes: 2 additions & 0 deletions modules/weblog/logline.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
// Variables:
// - nginx: http://nginx.org/en/docs/varindex.html
// - apache: http://httpd.apache.org/docs/current/mod/mod_log_config.html#logformat
// - IIS: https://learn.microsoft.com/en-us/windows/win32/http/w3c-logging

/*
| nginx | apache | description |
Expand Down Expand Up @@ -607,6 +608,7 @@ func isSSLProtoValid(proto string) bool {
}

func timeMultiplier(time string) float64 {
// TODO: Change code to detect and modify properly IIS time (in milliseconds)
// Convert to microseconds:
// - nginx time is in seconds with a milliseconds' resolution.
if strings.IndexByte(time, '.') > 0 {
Expand Down
Loading

0 comments on commit 33edc13

Please sign in to comment.