Documentation
¶
Overview ¶
- skogul, test avro parser
- Copyright (c) 2022 Telenor Norge AS
- Author:
- - Roshini Narasimha Raghavan <roshiragavi@gmail.com>
- - Kristian Lyngstøl <kly@kly.no> *
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version. *
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. *
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA
Package parser is responsible for interpreting raw byte data into Containers. Each parser is disconnected from how the byte data is received and what happens with it afterwards.
The simplest parser is probably the JSON parser, which simply assumes the byte slice is a JSON representation of a Skogul Container.
skogul, gob parser *
Copyright (c) 2022 Telenor Norge AS
Author(s):
- Roshini Narasimha Raghavan <roshiragavi@gmail.com>
- Kristian Lyngstøl <kly@kly.no>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. *
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. *
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
skogul, prometheus parser *
Copyright (c) 2022 Telenor Norge AS
Author(s):
- Roshini Narasimha Raghavan <roshiragavi@gmail.com>
- Kristian Lyngstøl <kly@kly.no>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. *
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. *
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Auto skogul.ModuleMap
Auto maps parser-names to parser implementation, used for auto configuration.
Functions ¶
This section is empty.
Types ¶
type AVRO ¶ added in v0.17.0
type AVRO struct { Schema string // contains filtered or unexported fields }
type AvroContainer ¶ added in v0.18.0
type AvroContainer struct { Template *AvroMetric Metrics []*AvroMetric }
type AvroMetric ¶ added in v0.18.0
type DummyStore ¶ added in v0.18.0
type DummyStore struct { File string `doc:"File name to write data to"` Append bool `doc:"Append or overwrite. By default, the file is repeatedly overwritten to capture just 1 packet"` // contains filtered or unexported fields }
DummyStore is a fake parser used to capture traffic Skogul doesn't understand, mainly for future development
type InfluxDB ¶ added in v0.6.0
type InfluxDB struct{}
InfluxDB provides a byte sequence parser for the InfluxDB Line Protocol https://docs.influxdata.com/influxdb/v1.7/write_protocols/line_protocol_tutorial/
type InfluxDBLineProtocol ¶ added in v0.6.0
type InfluxDBLineProtocol struct {
// contains filtered or unexported fields
}
InfluxDBLineProtocol is a struct with the same data types as defined in the InfluxDB Line Protocol; namely the measurement name, a set of tags, a set of fields and a timestamp.
func (*InfluxDBLineProtocol) Metric ¶ added in v0.6.0
func (line *InfluxDBLineProtocol) Metric() *skogul.Metric
Metric converts an internal InfluxDBLineProtocol struct to a skogul.Metric
func (*InfluxDBLineProtocol) ParseLine ¶ added in v0.6.0
func (line *InfluxDBLineProtocol) ParseLine(s string) error
ParseLine parses a single line into an internal InfluxDBLineProtocol
type JSON ¶
type JSON struct{}
JSON is schemaless JSON. If data is sent between Skogul instances, SkogulJSON should be used instead which retains the data structure Skogul works with. A distinction between 'Skogul' and 'JSON' is made because historically, Skogul accepted 'json' as a configuration option for its own JSON format, now named 'skogul'. JSON can be useful e.g. as the first step of parsing from a third party source where modifying the source data structure might be hard/impossible
type JSONMetric ¶ added in v0.16.0
type JSONMetric struct{}
JSONMetric matches encoder's EncodeMetric - reads the byte as a metric, not container
type MNR ¶ added in v0.8.1
type MNR struct { ExtractFieldName bool `doc:"Extract field name from 'name' parameter in MNR properties."` DefaultFieldName string `doc:"Name of field to store variable value in, in the case that 'name' is not present."` ParseAsString []string `doc:"Parse these properties as string (do not try to parse their value)."` StoreVariable bool `doc:"Store the uniquely generated variable as a data field."` // contains filtered or unexported fields }
MNR supports parsing MNR data through the Parse() function
type Prometheus ¶ added in v0.19.0
type Prometheus struct{}
type ProtoBuf ¶
type ProtoBuf struct { Debug bool `doc:"Logs the entire protobuf-packet if marshaling fails"` // contains filtered or unexported fields }
ProtoBuf parses a byte string-representation of a Container
type SkogulJSON ¶ added in v0.19.0
type SkogulJSON struct{}
SkogulJSON parses a byte string-representation of a Container in the format Skogul produces.
type StructuredData ¶ added in v0.10.0
type StructuredData struct { SDIDField string `doc:"The field to store the SDID in if it was present." default:"SD-ID"` // contains filtered or unexported fields }
StructuredData supports parsing RFC5424 structured data through the Parse() function Note: This does not parse a full syslog message. In the resulting metrics, there may be a metadata field which contains the SD-ID from the message if it was present. By default the metadata field is named SD-ID, but it may be overridden in configuration. SD-ID: https://datatracker.ietf.org/doc/html/draft-ietf-syslog-protocol-23#section-6.3.2
type USP_Parser ¶ added in v0.18.0
type USP_Parser struct {
// contains filtered or unexported fields
}