Skip to content

Commit

Permalink
[Filebeat] Improve ECS categorization field mappings in ibmmq (elasti…
Browse files Browse the repository at this point in the history
…c#16532)

- event.kind
- convert pipeline to yaml

Closes elastic#16163

(cherry picked from commit a91cc9e)
  • Loading branch information
leehinman committed Mar 11, 2020
1 parent 3078ed1 commit f1c25ce
Show file tree
Hide file tree
Showing 7 changed files with 298 additions and 109 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Allow users to override pipeline ID in fileset input config. {issue}9531[9531] {pull}16561[16561]
- Improve ECS categorization field mappings in logstash module. {issue}16169[16169] {pull}16668[16668]
- Improve ECS categorization field mappings in iis module. {issue}16165[16165] {pull}16618[16618]
- Improve ECS categorization field mappings in ibmmq module. {issue}16163[16163] {pull}16532[16532]

*Heartbeat*

Expand Down
108 changes: 0 additions & 108 deletions x-pack/filebeat/module/ibmmq/errorlog/ingest/pipeline.json

This file was deleted.

76 changes: 76 additions & 0 deletions x-pack/filebeat/module/ibmmq/errorlog/ingest/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
description: Pipeline for parsing MQ error logs.
processors:
- gsub:
field: message
pattern: ^[\-]{5}[a-z0-9\. :]*[\-]{5,}
replacement: ""
- gsub:
field: message
pattern: |2+
replacement: ' '
- gsub:
field: message
pattern: '[ ]{2,}'
replacement: ' '
- trim:
field: message
- rename:
field: '@timestamp'
target_field: event.created
- grok:
field: message
patterns:
- ^%{DATA:log_timestamp} -
- grok:
field: message
patterns:
- 'Process\(%{DATA:process.pid}\) User\(%{WORD:user.name}\) Program\(%{DATA:process.title}\)
Host\(%{DATA:host.hostname}\) Installation\(%{WORD:ibmmq.errorlog.installation}\)
VRMF\(%{DATA:service.version}\)( QMgr\(%{DATA:ibmmq.errorlog.qmgr}\))?( Time\(%{TIMESTAMP_ISO8601:@timestamp}\))?(
RemoteHost\(%{DATA:destination.address}\))?( ArithInsert1\(%{DATA:ibmmq.errorlog.arithinsert1}\))?(
ArithInsert2\(%{DATA:ibmmq.errorlog.arithinsert2}\))?( CommentInsert1\(%{DATA:ibmmq.errorlog.commentinsert1}\))?(
CommentInsert2\(%{DATA:ibmmq.errorlog.commentinsert2}\))?( CommentInsert3\(%{DATA:ibmmq.errorlog.commentinsert3}\))?
(?=AMQ[0-9]{4})%{DATA:ibmmq.errorlog.code}((?<=AMQ[0-9]{4}[A-Z])%{DATA:log.level})?:
%{DATA:ibmmq.errorlog.errordescription} [^\ ]+:( %{DATA:ibmmq.errorlog.explanation})?
[^\ ]+:( %{DATA:ibmmq.errorlog.action})?$'
- date:
field: log_timestamp
target_field: '@timestamp'
formats:
- MM/dd/yyyy hh:mm:ss aa
- dd/MM/yyyy HH:mm:ss
ignore_failure: true
- append:
field: ibmmq.errorlog.commentinsert
value:
- '{{ibmmq.errorlog.commentinsert1}}'
- '{{ibmmq.errorlog.commentinsert2}}'
- '{{ibmmq.errorlog.commentinsert3}}'
ignore_failure: true
- append:
field: ibmmq.errorlog.arithinsert
value:
- '{{ibmmq.errorlog.arithinsert1}}'
- '{{ibmmq.errorlog.arithinsert2}}'
ignore_failure: true
- remove:
field:
- log_timestamp
- message
- ibmmq.errorlog.arithinsert1
- ibmmq.errorlog.arithinsert2
- ibmmq.errorlog.commentinsert1
- ibmmq.errorlog.commentinsert2
- ibmmq.errorlog.commentinsert3
ignore_missing: true
- rename:
field: ibmmq.errorlog.errordescription
target_field: message
- set:
field: event.kind
value: event
on_failure:
- set:
field: error.message
value: 'pipeline-entry: {{ _ingest.on_failure_message }}'
2 changes: 1 addition & 1 deletion x-pack/filebeat/module/ibmmq/errorlog/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ var:
- C:\ProgramData\IBM\MQ\errors\*.LOG*
- C:\ProgramData\IBM\MQ\qmgrs\*\errors\*.LOG*

ingest_pipeline: ingest/pipeline.json
ingest_pipeline: ingest/pipeline.yml
input: config/errorlog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"@timestamp": "2018-10-11T08:39:30.731Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -34,6 +35,7 @@
{
"@timestamp": "2018-10-11T08:39:30.729Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -66,6 +68,7 @@
{
"@timestamp": "2018-10-11T10:46:25.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -98,6 +101,7 @@
{
"@timestamp": "2018-10-11T10:46:26.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -130,6 +134,7 @@
{
"@timestamp": "2018-10-11T10:46:26.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -162,6 +167,7 @@
{
"@timestamp": "2018-10-17T11:50:15.982Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -194,6 +200,7 @@
{
"@timestamp": "2018-10-17T11:50:18.439Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -226,6 +233,7 @@
{
"@timestamp": "2018-10-18T14:13:58.401Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -258,6 +266,7 @@
{
"@timestamp": "2018-10-28T15:12:07.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -290,6 +299,7 @@
{
"@timestamp": "2018-10-28T15:12:07.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -322,6 +332,7 @@
{
"@timestamp": "2018-10-28T15:12:08.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -354,6 +365,7 @@
{
"@timestamp": "2018-10-28T15:12:08.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -386,6 +398,7 @@
{
"@timestamp": "2018-10-29T16:48:52.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -418,6 +431,7 @@
{
"@timestamp": "2018-10-29T16:48:52.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -450,6 +464,7 @@
{
"@timestamp": "2018-10-29T16:48:53.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -482,6 +497,7 @@
{
"@timestamp": "2018-10-29T16:48:53.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -514,6 +530,7 @@
{
"@timestamp": "2018-10-29T16:49:35.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -546,6 +563,7 @@
{
"@timestamp": "2018-10-29T16:49:35.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -578,6 +596,7 @@
{
"@timestamp": "2018-10-29T16:49:36.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down Expand Up @@ -610,6 +629,7 @@
{
"@timestamp": "2018-10-29T16:49:36.000Z",
"event.dataset": "ibmmq.errorlog",
"event.kind": "event",
"event.module": "ibmmq",
"fileset.name": "errorlog",
"host.hostname": "FELIX-ELASTIC",
Expand Down
Loading

0 comments on commit f1c25ce

Please sign in to comment.