Documentation ¶
Index ¶
- Constants
- Variables
- type ServiceJournal
- func (sj *ServiceJournal) Collect(pipeline.Collector) error
- func (sj *ServiceJournal) Description() string
- func (sj *ServiceJournal) Follow(journal *sdjournal.Journal, stop <-chan struct{}) <-chan *sdjournal.JournalEntry
- func (sj *ServiceJournal) Init(context pipeline.Context) (int, error)
- func (sj *ServiceJournal) LoadCheckpoint()
- func (sj *ServiceJournal) SaveCheckpoint(forceFlag bool)
- func (sj *ServiceJournal) Start(c pipeline.Collector) error
- func (sj *ServiceJournal) Stop() error
Constants ¶
const ( SeekPositionCursor = "cursor" SeekPositionHead = "head" SeekPositionTail = "tail" SeekPositionDefault = "none" )
Named constants for the journal cursor placement positions
const SD_JOURNAL_FIELD_CATALOG_ENTRY = "CATALOG_ENTRY"
SD_JOURNAL_FIELD_CATALOG_ENTRY stores the name of the JournalEntry field to export Catalog entry to.
Variables ¶
var PriorityConversionMap = map[string]string{
"0": "emergency",
"1": "alert",
"2": "critical",
"3": "error",
"4": "warning",
"5": "notice",
"6": "informational",
"7": "debug",
}
PriorityConversionMap is a map containing the textual equivalence of a given priority string number
var SyslogFacilityString = map[string]string{
"0": "kernel",
"1": "user",
"2": "mail",
"3": "daemon",
"4": "auth",
"5": "syslog",
"6": "line printer",
"7": "network news",
"8": "uucp",
"9": "clock daemon",
"10": "security/auth",
"11": "ftp",
"12": "ntp",
"13": "log audit",
"14": "log alert",
"15": "clock daemon",
"16": "local0",
"17": "local1",
"18": "local2",
"19": "local3",
"20": "local4",
"21": "local5",
"22": "local6",
"23": "local7",
}
SyslogFacilityString is a map containing the textual equivalence of a given facility number
Functions ¶
This section is empty.
Types ¶
type ServiceJournal ¶
type ServiceJournal struct { SeekPosition string CursorFlushPeriodMs int CursorSeekFallback string Units []string Kernel bool Identifiers []string JournalPaths []string MatchPatterns []string ParseSyslogFacility bool ParsePriority bool UseJournalEventTime bool ResetIntervalSecond int // contains filtered or unexported fields }
func (*ServiceJournal) Collect ¶
func (sj *ServiceJournal) Collect(pipeline.Collector) error
Collect takes in an accumulator and adds the metrics that the Input gathers. This is called every "interval"
func (*ServiceJournal) Description ¶
func (sj *ServiceJournal) Description() string
func (*ServiceJournal) Follow ¶
func (sj *ServiceJournal) Follow(journal *sdjournal.Journal, stop <-chan struct{}) <-chan *sdjournal.JournalEntry
Follow follows the journald and writes the entries to the output channel It is a slightly reworked version of sdjournal.Follow to fit our needs.
func (*ServiceJournal) LoadCheckpoint ¶
func (sj *ServiceJournal) LoadCheckpoint()
func (*ServiceJournal) SaveCheckpoint ¶
func (sj *ServiceJournal) SaveCheckpoint(forceFlag bool)
func (*ServiceJournal) Start ¶
func (sj *ServiceJournal) Start(c pipeline.Collector) error
Start starts the ServiceInput's service, whatever that may be
func (*ServiceJournal) Stop ¶
func (sj *ServiceJournal) Stop() error
Stop stops the services and closes any necessary channels and connections