-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Auditbeat] Cherry-pick #10225 to 6.x: System module: Update and re-e…
…nable package dataset (#10400) Cherry-pick of PR #10225 to 6.x branch. Original message: Re-enables the disabled `package` dataset and brings it up to date with the other, soon-to-be released datasets. High-level changes: - Renamed to `package` (singular) - Scheduled state reporting based on `state.period` and `package.state.period` - Common fields: `event.kind`, `event.action`, `event.id`, `message` - Save/Restore package information to disk
- Loading branch information
Christoph Wurm
authored
Feb 1, 2019
1 parent
329ce20
commit 33217a6
Showing
18 changed files
with
863 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//// | ||
This file is generated! See scripts/docs_collector.py | ||
//// | ||
|
||
[id="{beatname_lc}-dataset-system-package"] | ||
=== System package dataset | ||
|
||
include::../../../module/system/package/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the dataset, see the | ||
<<exported-fields-system,exported fields>> section. | ||
|
||
Here is an example document generated by this dataset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../module/system/package/_meta/data.json[] | ||
---- |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"@timestamp": "2017-10-12T08:05:34.853Z", | ||
"agent": { | ||
"hostname": "host.example.com", | ||
"name": "host.example.com" | ||
}, | ||
"event": { | ||
"action": "existing_package", | ||
"dataset": "package", | ||
"id": "9ac4ea4c-5a0c-475f-b4c9-ec9d981ff11b", | ||
"kind": "state", | ||
"module": "system" | ||
}, | ||
"message": "Package zstd (1.3.5) is already installed", | ||
"service": { | ||
"type": "system" | ||
}, | ||
"system": { | ||
"audit": { | ||
"package": { | ||
"installtime": "2018-08-30T18:41:23.85657356+01:00", | ||
"name": "zstd", | ||
"summary": "Zstandard is a real-time compression algorithm", | ||
"url": "http://zstd.net/", | ||
"version": "1.3.5" | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[role="xpack"] | ||
|
||
experimental[] | ||
|
||
This is the `package` dataset of the system module. | ||
|
||
It is implemented for Linux distributions using dpkg as their package manager, | ||
and for Homebrew on macOS (Darwin). |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
- name: package | ||
type: group | ||
description: > | ||
`package` contains information about an installed or removed package. | ||
release: experimental | ||
fields: | ||
- name: name | ||
type: keyword | ||
description: > | ||
Package name. | ||
- name: version | ||
type: keyword | ||
description: > | ||
Package version. | ||
- name: release | ||
type: keyword | ||
description: > | ||
Package release. | ||
- name: arch | ||
type: keyword | ||
description: > | ||
Package architecture. | ||
- name: license | ||
type: keyword | ||
description: > | ||
Package license. | ||
- name: installtime | ||
type: date | ||
description: > | ||
Package install time. | ||
- name: size | ||
type: long | ||
description: > | ||
Package size. | ||
- name: summary | ||
description: > | ||
Package summary. | ||
- name: url | ||
type: keyword | ||
description: > | ||
Package URL. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License; | ||
// you may not use this file except in compliance with the Elastic License. | ||
|
||
// +build !windows | ||
|
||
package pkg | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
// config defines the package metricset's configuration options. | ||
type config struct { | ||
StatePeriod time.Duration `config:"state.period"` | ||
PackageStatePeriod time.Duration `config:"package.state.period"` | ||
} | ||
|
||
func (c *config) effectiveStatePeriod() time.Duration { | ||
if c.PackageStatePeriod != 0 { | ||
return c.PackageStatePeriod | ||
} | ||
return c.StatePeriod | ||
} | ||
|
||
func defaultConfig() config { | ||
return config{ | ||
StatePeriod: 12 * time.Hour, | ||
} | ||
} |
Oops, something went wrong.