Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filebeat]Azure module - activity logs #13776

Merged
merged 24 commits into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ grouped in the following categories:
* <<exported-fields-apache>>
* <<exported-fields-auditd>>
* <<exported-fields-aws>>
* <<exported-fields-azure>>
* <<exported-fields-azure>>
* <<exported-fields-beat-common>>
* <<exported-fields-cef>>
* <<exported-fields-cef-module>>
Expand Down Expand Up @@ -1241,6 +1243,31 @@ type: keyword

--

[[exported-fields-azure]]
== azure fields

azure Module



[float]
=== azure




[float]
=== activitylogs

Fields for azure Activity logs.


[[exported-fields-azure]]
== Decode azure processor fields fields

Common Event Format (azure) data.


[[exported-fields-beat-common]]
== Beat fields

Expand Down
60 changes: 60 additions & 0 deletions filebeat/docs/modules/azure.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
////
This file is generated! See scripts/docs_collector.py
////

[[filebeat-module-azure]]
:modulename: azure
:has-dashboards: true

== azure module

This is the azure module.

include::../include/what-happens.asciidoc[]

[float]
=== Compatibility

TODO: document with what versions of the software is this tested


include::../include/running-modules.asciidoc[]

[float]
=== Example dashboard

This module comes with a sample dashboard. For example:

TODO: include an image of a sample dashboard. If you do not include a dashboard,
remove this section and set `:has-dashboards: false` at the top of this file.

include::../include/configuring-intro.asciidoc[]

TODO: provide an example configuration

:fileset_ex: {fileset}

include::../include/config-option-intro.asciidoc[]

TODO: document the variables from each fileset. If you're describing a variable
that's common to other modules, you can reuse shared descriptions by including
the relevant file. For example:

[float]
==== `{fileset}` log fileset settings

include::../include/var-paths.asciidoc[]

:has-dashboards!:

:fileset_ex!:

:modulename!:


[float]
=== Fields

For a description of each field in the module, see the
<<exported-fields-azure,exported fields>> section.

2 changes: 2 additions & 0 deletions filebeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This file is generated! See scripts/docs_collector.py
* <<filebeat-module-apache>>
* <<filebeat-module-auditd>>
* <<filebeat-module-aws>>
* <<filebeat-module-azure>>
* <<filebeat-module-cef>>
* <<filebeat-module-cisco>>
* <<filebeat-module-coredns>>
Expand Down Expand Up @@ -44,6 +45,7 @@ include::modules-overview.asciidoc[]
include::modules/apache.asciidoc[]
include::modules/auditd.asciidoc[]
include::modules/aws.asciidoc[]
include::modules/azure.asciidoc[]
include::modules/cef.asciidoc[]
include::modules/cisco.asciidoc[]
include::modules/coredns.asciidoc[]
Expand Down
10 changes: 5 additions & 5 deletions filebeat/input/kafka/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/elastic/beats/libbeat/outputs"
)

type kafkaInputConfig struct {
type KafkaInputConfig struct {
narph marked this conversation as resolved.
Show resolved Hide resolved
// Kafka hosts with port, e.g. "localhost:9092"
Hosts []string `config:"hosts" validate:"required"`
Topics []string `config:"topics" validate:"required"`
Expand Down Expand Up @@ -103,8 +103,8 @@ var (

// The default config for the kafka input. When in doubt, default values
// were chosen to match sarama's defaults.
func defaultConfig() kafkaInputConfig {
return kafkaInputConfig{
func DefaultConfig() KafkaInputConfig {
return KafkaInputConfig{
Version: kafka.Version("1.0.0"),
InitialOffset: initialOffsetOldest,
ClientID: "filebeat",
Expand All @@ -128,7 +128,7 @@ func defaultConfig() kafkaInputConfig {
}

// Validate validates the config.
func (c *kafkaInputConfig) Validate() error {
func (c *KafkaInputConfig) Validate() error {
if len(c.Hosts) == 0 {
return errors.New("no hosts configured")
}
Expand All @@ -143,7 +143,7 @@ func (c *kafkaInputConfig) Validate() error {
return nil
}

func newSaramaConfig(config kafkaInputConfig) (*sarama.Config, error) {
func NewSaramaConfig(config KafkaInputConfig) (*sarama.Config, error) {
narph marked this conversation as resolved.
Show resolved Hide resolved
k := sarama.NewConfig()

version, ok := config.Version.Get()
Expand Down
6 changes: 3 additions & 3 deletions filebeat/input/kafka/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func init() {

// Input contains the input and its config
type kafkaInput struct {
config kafkaInputConfig
config KafkaInputConfig
saramaConfig *sarama.Config
context input.Context
outlet channel.Outleter
Expand All @@ -62,7 +62,7 @@ func NewInput(
inputContext input.Context,
) (input.Input, error) {

config := defaultConfig()
config := DefaultConfig()
if err := cfg.Unpack(&config); err != nil {
return nil, errors.Wrap(err, "reading kafka input config")
}
Expand All @@ -85,7 +85,7 @@ func NewInput(
return nil, err
}

saramaConfig, err := newSaramaConfig(config)
saramaConfig, err := NewSaramaConfig(config)
if err != nil {
return nil, errors.Wrap(err, "initializing Sarama config")
}
Expand Down
15 changes: 15 additions & 0 deletions x-pack/filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ filebeat.modules:
# Profile name for aws credential
#var.credential_profile_name: fb-aws

#-------------------------------- Azure Module --------------------------------
- module: azure
# All logs
activitylogs:
enabled: true
var:
eventhubs_namespace: ""
topics: ["insights-operational-logs"]
consumer_group: "$Default"
connection_string: ""

# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:

#--------------------------------- CEF Module ---------------------------------
- module: cef
log:
Expand Down
2 changes: 2 additions & 0 deletions x-pack/filebeat/include/list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading