-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor formatters to use metadata as intermediate (#249)
* convert grokToJSON to grok to metadata * remove collectd to influx formatter. Resons: - This formatter is too specific. - A collectd consumer and an influxdb producer should handle this instead. - There is other software doing this kind of work better than gollum (e.g. telegraph). * remove extractToJSON. Reason: This kind of functionality will be handled by formatters converting metadata to a specific output format like JSON. * remove jsonToInflux. Same reason as collectdToInflux. * convert jsonToArray to ToArray to match the new metadata concept. * remove serialize formatter as spooling does not need it anymore. * add a formater that can convert metadata to json * remove filter.json go as it will be replaced by filter.metadata. * rename 'ApplyTo' to 'Target'. - includes renaming format.MetadataCopy to format.Copy. - includes adding format.Move As we now put more emphasis on metadata, 'target' becomes a much clearer identifier. Along with this, the names for Set and Get functions have been simplified. This should make formatter configurations more readable and easier to understand. * use a better example for format.double * add an option to keep the last separator * finish format.ToJSON * remove format.TextToJSON. - Nobody understood the syntax anyways. - format.Grok can handle most of its usecases. - A high maintenance burden for a too small usecase. * rename format.Clear to format.Delete * remove unittest for texttojson * rename format.Trim to format.Bounds. There will be a new format.Trim that uses strings.Trim. * add format.Trim * rename format.Bounds to format.TrimToBounds * introduce Source parameter to all SimpleFormatter. - Also includes targeting a specific metadata key for parser formatter. * add a metadata access function for parsers * switch aggregate from Target to Source * fix metadata being properly cloned on msg.Clone * add target data getter * fix base64 encoding tests * fix copy unittests and simplify code * make format.Double respect source and target fields * fix source/target related unittest failures * fix expected error checking * fix source/target related unittest errors * rename applyTo to identifier for setter functions * retain type when moving metadata * add unittest for format.Move * add split formatter * change splitpick default delimiter to "," * add documentation for dynamic functions * add format.Replace * add a unittest for format.Trim * add format.flatten * add format.agent * add format.GeoIP * remove process* formatters. All subformatters have been moved to be separate formaters working on metadata. * rename toArray to toCSV * add format.ConvertTime * allow full string replacement * reintroduce ApplyTo to set Source and Target to the same value * change templateJSON to template * convert SplitToJSON into SplitToFields * fix trim to bounds behavior and test * make geoip file loading a non-breaking error * add json parser formatter * allow split to fields to target root * update json benchmark * fix config for regexp filter integration test * delete removed formatters/filters * update dependencies * exchange strings.ReplaceAll with strings.Replace. This enables downwards compatibility.
- Loading branch information
Showing
667 changed files
with
17,221 additions
and
132,837 deletions.
There are no files selected for viewing
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
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
Oops, something went wrong.