journalctl

package module
v0.0.0-...-dc78d9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2015 License: LGPL-3.0 Imports: 5 Imported by: 0

README

journalctl-go
===================
[![GoDoc](https://godoc.org/github.com/ChimeraCoder/journalctl-go?status.png)](https://godoc.org/github.com/ChimeraCoder/journalctl-go)

A Go client interface for reading the systemd journal, using `systemd-journal-gatewayd`.



##### Disclaimer
This is currently an experimental package, and the API is subject to change.

Documentation

Index

Constants

View Source
const DefaultHost = "http://localhost:19531"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Host string
	// contains filtered or unexported fields
}

A Client is used for accessing the journal (through systemd-journal-gatewayd.service) Like http.DefaultClient, its zero value (DefaultClient) is a usable client that connects to localhost on the default port (http://localhost:19531)

func (*Client) Entries

func (c *Client) Entries(filter *Entry) (entries chan Entry, err error)

Entries will return a list of entries. If a non-nil filter is passed, any non-empty entries will be used to filter the query. For example, Entry{SYSTEMD_UNIT: "my-service.service"} will return only entries matching this unit name. Note that the systemd journal does not allow filtering on all journal field names.

type Entry

type Entry struct {
	MESSAGE                 interface{} `json:"MESSAGE"`
	PRIORITY                string      `json:"PRIORITY"`
	SYSLOGFACILITY          string      `json:"SYSLOG_FACILITY"`
	SYSLOGIDENTIFIER        string      `json:"SYSLOG_IDENTIFIER"`
	AUDITLOGINUID           string      `json:"_AUDIT_LOGINUID"`
	AUDITSESSION            string      `json:"_AUDIT_SESSION"`
	BOOTID                  string      `json:"_BOOT_ID"`
	CAPEFFECTIVE            string      `json:"_CAP_EFFECTIVE"`
	CMDLINE                 string      `json:"_CMDLINE"`
	COMM                    string      `json:"_COMM"`
	EXE                     string      `json:"_EXE"`
	GID                     string      `json:"_GID"`
	HOSTNAME                string      `json:"_HOSTNAME"`
	MACHINEID               string      `json:"_MACHINE_ID"`
	PID                     string      `json:"_PID"`
	SELINUXCONTEXT          string      `json:"_SELINUX_CONTEXT"`
	SOURCEREALTIMETIMESTAMP string      `json:"_SOURCE_REALTIME_TIMESTAMP"`
	SYSTEMDCGROUP           string      `json:"_SYSTEMD_CGROUP"`
	SYSTEMDOWNERUID         string      `json:"_SYSTEMD_OWNER_UID"`
	SYSTEMDSESSION          string      `json:"_SYSTEMD_SESSION"`
	SYSTEMDSLICE            string      `json:"_SYSTEMD_SLICE"`
	SYSTEMDUNIT             string      `json:"_SYSTEMD_UNIT"`
	TRANSPORT               string      `json:"_TRANSPORT"`
	UID                     string      `json:"_UID"`
	CURSOR                  string      `json:"__CURSOR"`
	MONOTONICTIMESTAMP      string      `json:"__MONOTONIC_TIMESTAMP"`
	REALTIMETIMESTAMP       string      `json:"__REALTIME_TIMESTAMP"`
}

func (Entry) Message

func (e Entry) Message() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL