Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of apache trace log levels #2064

Merged
merged 6 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/apache/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.3.1"
changes:
- description: Fix parsing of trace log levels
type: bugfix
link: https://github.com/elastic/integrations/pull/2064
- version: "1.3.0"
changes:
- description: Support Kibana 8.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Wed Oct 20 19:20:59.121211 2021] [rewrite:trace3] [pid 121591:tid 140413273032448] mod_rewrite.c(470): [client 10.121.192.8:38350] 10.121.192.8 - - [dev.elastic.co/sid#55a374e851c8][rid#7fb438083ac0/initial] applying pattern '^/import/?(.*)$' to uri '/'
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"expected": [
{
"process": {
"pid": 121591,
"thread": {
"id": 140413273032448
}
},
"apache": {
"error": {
"module": "rewrite"
}
},
"@timestamp": "2021-10-20T19:20:59.121+02:00",
"ecs": {
"version": "1.12.0"
},
"log": {
"level": "trace3"
},
"event": {
"ingested": "2021-10-29T11:35:09.169407941Z",
"original": "[Wed Oct 20 19:20:59.121211 2021] [rewrite:trace3] [pid 121591:tid 140413273032448] mod_rewrite.c(470): [client 10.121.192.8:38350] 10.121.192.8 - - [dev.elastic.co/sid#55a374e851c8][rid#7fb438083ac0/initial] applying pattern '^/import/?(.*)$' to uri '/'",
"category": "web",
"type": "info",
"timezone": "GMT+2",
"kind": "event"
},
"message": "mod_rewrite.c(470): [client 10.121.192.8:38350] 10.121.192.8 - - [dev.elastic.co/sid#55a374e851c8][rid#7fb438083ac0/initial] applying pattern '^/import/?(.*)$' to uri '/'",
"tags": [
"preserve_original_event"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ processors:
patterns:
- \[%{APACHE_TIME:apache.error.timestamp}\] \[%{LOGLEVEL:log.level}\]( \[client
%{IPORHOST:source.address}(:%{POSINT:source.port})?\])? %{GREEDYDATA:message}
- \[%{APACHE_TIME:apache.error.timestamp}\] \[%{DATA:apache.error.module}:%{LOGLEVEL:log.level}\]
- \[%{APACHE_TIME:apache.error.timestamp}\] \[%{DATA:apache.error.module}:%{APACHE_LOGLEVEL:log.level}\]
\[pid %{NUMBER:process.pid:long}(:tid %{NUMBER:process.thread.id:long})?\](
\[client %{IPORHOST:source.address}(:%{POSINT:source.port})?\])? %{GREEDYDATA:message}
pattern_definitions:
# Apache log level can have numeric sub-levels such as trace1.
APACHE_LOGLEVEL: '%{LOGLEVEL}[0-9]*'
APACHE_TIME: '%{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{YEAR}'
ignore_missing: true
- grok:
Expand Down
2 changes: 1 addition & 1 deletion packages/apache/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 1.0.0
name: apache
title: Apache HTTP Server
version: 1.3.0
version: 1.3.1
license: basic
description: Collect logs and metrics from Apache servers with Elastic Agent.
type: integration
Expand Down