Hi,
I am receiving the below error whilst trying to use filebeat to read log. I know that I can explicitly exclude the field %{processID} by appending ? %{?processID}, but sometimes the processID is valid integer and process successfully. As the code is out of my control I am unable to update it at source.
Error in log:
2021-02-13T14:06:57.055+0200 DEBUG [processors] processing/processors.go:112 Fail to apply processor client{rename=[{From:message To:rawMessage}], dissect=Host=%{hostname} %{date} %{time},%{milliseconds} (%{processId}) [%{threadId}] %{log.level->} %{appId} - %{message},field=rawMessage,target_prefix=, convert={"Fields":[{"From":"processId","To":"","Type":"integer"},{"From":"threadId","To":"","Type":"integer"}],"Tag":"","IgnoreMissing":true,"FailOnError":true,"Mode":"copy"}, add_locale=[format=offset], script=[type=javascript, id=, sources=inline.js], timestamp=[field=sourceTimestamp, target_field=@timestamp, timezone=UTC, layouts=[2006-01-02T15:04:05.000 -07:00]], drop_fields={"Fields":["hostname","date","time","event.timezone","sourceTimestamp","rawMessage"],"IgnoreMissing":true}}: failed in processor.convert: conversion of field [processId] to type [integer] failed: unable to convert value [null]: strconv.ParseInt: parsing "null": invalid syntax
Log Entry Example:
Host=ZAUSDCMAPP0185 2021-02-13 14:16:00,824 (null) [5] INFO AISFWKService.Program - Run Main Loop, threads running : 0
Processor extract from filebeat.yml
processors:
- rename:
fields:
- from: "message"
to: "rawMessage"
- dissect:
tokenizer: "Host=%{hostname} %{date} %{time},%{milliseconds} (%{processId}) [%{threadId}] %{log.level->} %{appId} - %{message}"
field: "rawMessage"
target_prefix: ''
- convert:
fields:
- {
from: "processId",
type: "integer",
on_failure: [
{
set: {
field: "processId",
value: 0
}
}
]
}
- {from: "threadId", type: "integer"}
ignore_missing: true
fail_on_error: true
- add_locale: ~
- script:
lang: javascript
id: my_filter
source: >
function process(event) {
event.Put("sourceTimestamp", event.Get("date") + "T" + event.Get("time") + "." + event.Get("milliseconds") + " " + event.Get("event.timezone") );
}
- timestamp:
field: "sourceTimestamp"
layouts:
- '2006-01-02T15:04:05.000 -07:00'
- drop_fields:
fields: ["hostname", "date", "time", "event.timezone", "sourceTimestamp", "rawMessage"]
ignore_missing: true
Please can you assist?