-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Basic parsing of syslog fields * Supports multiline messages if the lines after the first one start with a space. * Contains a simple Kibana dashboard
- Loading branch information
Showing
13 changed files
with
751 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
filebeat/_meta/kibana/dashboard/Filebeat-syslog-dashboard.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"hits": 0, | ||
"timeRestore": false, | ||
"description": "", | ||
"title": "Filebeat syslog dashboard", | ||
"uiStateJSON": "{}", | ||
"panelsJSON": "[{\"id\":\"Syslog-events-by-hostname\",\"type\":\"visualization\",\"panelIndex\":1,\"size_x\":8,\"size_y\":4,\"col\":1,\"row\":1},{\"id\":\"Syslog-hostnames-and-processes\",\"type\":\"visualization\",\"panelIndex\":2,\"size_x\":4,\"size_y\":4,\"col\":9,\"row\":1},{\"id\":\"Syslog-system-logs\",\"type\":\"search\",\"panelIndex\":3,\"size_x\":12,\"size_y\":7,\"col\":1,\"row\":5,\"columns\":[\"syslog.system.hostname\",\"syslog.system.program\",\"syslog.system.message\"],\"sort\":[\"@timestamp\",\"desc\"]}]", | ||
"optionsJSON": "{\"darkTheme\":false}", | ||
"version": 1, | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"filter\":[{\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}}}]}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"sort": [ | ||
"@timestamp", | ||
"desc" | ||
], | ||
"hits": 0, | ||
"description": "", | ||
"title": "Syslog system logs", | ||
"version": 1, | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"index\":\"filebeat-*\",\"filter\":[],\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"require_field_match\":false,\"fragment_size\":2147483647},\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}}}" | ||
}, | ||
"columns": [ | ||
"syslog.system.hostname", | ||
"syslog.system.program", | ||
"syslog.system.message" | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
filebeat/_meta/kibana/visualization/Syslog-events-by-hostname.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"visState": "{\"title\":\"Syslog events by hostname\",\"type\":\"histogram\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"scale\":\"linear\",\"mode\":\"stacked\",\"times\":[],\"addTimeMarker\":false,\"defaultYExtents\":false,\"setYExtents\":false,\"yAxis\":{}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"group\",\"params\":{\"field\":\"syslog.system.hostname\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}", | ||
"description": "", | ||
"title": "Syslog events by hostname", | ||
"uiStateJSON": "{}", | ||
"version": 1, | ||
"savedSearchId": "Syslog-system-logs", | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"filter\":[]}" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
filebeat/_meta/kibana/visualization/Syslog-hostnames-and-processes.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"visState": "{\"title\":\"Syslog hostnames and processes\",\"type\":\"pie\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"bottom\",\"isDonut\":true},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"syslog.system.hostname\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"syslog.system.program\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}", | ||
"description": "", | ||
"title": "Syslog hostnames and processes", | ||
"uiStateJSON": "{}", | ||
"version": 1, | ||
"savedSearchId": "Syslog-system-logs", | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"filter\":[]}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- key: syslog | ||
title: "Syslog" | ||
description: > | ||
Module for parsing syslog files. | ||
fields: | ||
- name: syslog | ||
type: group | ||
description: > | ||
Fields from the syslog files. | ||
fields: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
- name: system | ||
type: group | ||
description: > | ||
Contains fields from the syslog system logs. | ||
fields: | ||
- name: timestamp | ||
description: > | ||
The timestamp as read from the syslog message. | ||
- name: hostname | ||
description: > | ||
The hostname as read from the syslog message. | ||
- name: program | ||
description: > | ||
The process name as read from the syslog message. | ||
- name: pid | ||
description: > | ||
The PID of the process that sent the syslog message. | ||
- name: message | ||
description: > | ||
The message in the log line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- input_type: log | ||
paths: | ||
- {{path}} | ||
multiline: | ||
pattern: "^\\s" | ||
match: after | ||
fields: | ||
source_type: syslog-system | ||
pipeline_id: {{beat.pipeline_id}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"description": "Pipeline for parsing Syslog messages.", | ||
"processors": [ | ||
{ | ||
"grok": { | ||
"field": "message", | ||
"patterns": [ | ||
"%{SYSLOGTIMESTAMP:syslog.system.timestamp} %{SYSLOGHOST:syslog.system.hostname} %{DATA:syslog.system.program}(?:\\[%{POSINT:syslog.system.pid}\\])?: %{GREEDYMULTILINE:syslog.system.message}" | ||
], | ||
"pattern_definitions" : { | ||
"GREEDYMULTILINE" : "(.|\n)*" | ||
}, | ||
"ignore_missing": true | ||
} | ||
}, | ||
{ | ||
"remove": { | ||
"field": "message" | ||
} | ||
}, | ||
{ | ||
"date": { | ||
"field": "syslog.system.timestamp", | ||
"target_field": "@timestamp", | ||
"formats": [ | ||
"MMM d HH:mm:ss", | ||
"MMM dd HH:mm:ss" | ||
], | ||
"ignore_failure": true | ||
} | ||
} | ||
], | ||
"on_failure" : [{ | ||
"set" : { | ||
"field" : "error", | ||
"value" : "{{ _ingest.on_failure_message }}" | ||
} | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module_version: 1.0 | ||
|
||
vars: | ||
path: | ||
default: /var/log/messages | ||
os.darwin: /var/log/system.log | ||
|
||
ingest_pipeline: ingest/pipeline.json | ||
prospectors: | ||
- config/system.yml |
Oops, something went wrong.