Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Data type specification for MDC fields #59

Closed
mp911de opened this issue Dec 12, 2015 · 1 comment
Closed

Data type specification for MDC fields #59

mp911de opened this issue Dec 12, 2015 · 1 comment
Labels
type: enhancement A general enhancement

Comments

@mp911de
Copy link
Owner

mp911de commented Dec 12, 2015

MDC fields contain various data types. String and numeric types are currently passed over GELF. When a field contains a numeric content (such as 42 or 12.34) the numeric value is parsed using Long.parseLong and Double.parseDouble to determine a parseable format.

Users of Graylog run into issues as soon as the data type of a particular field varies. logstash-gelf requires a possibility to specify fixed types to support Graylog > 1.2.x.

The type specification is not needed in most cases so it should be opt-in but once a type is set, it must be honored. A possible style to define types could be either:

mdcFields=Application,Version=long,SomeOtherFieldName=double,SomeOtherFieldName2=String

with colon:

mdcFields=Application,Version:long,SomeOtherFieldName:double,SomeOtherFieldName2:String

or

mdcFields=Application,Version,SomeOtherFieldName,SomeOtherFieldName2
mdcFieldTypes=Version=long,SomeOtherFieldName=double,SomeOtherFieldName2=String
includeFullMdc=true
mdcFieldTypes=Version=long,SomeOtherFieldName=double,SomeOtherFieldName2=String

Types

  • long
  • double
  • String

Open points

  • What if a value cannot be parsed (e.g. type double but value is fadsfds)?
    • Possibility 1: Omit the field
    • Possibility 2: Return zero value

Reported by @kebers

@mp911de
Copy link
Owner Author

mp911de commented Jan 5, 2016

Implemented.

@mp911de mp911de closed this as completed Jan 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant