Skip to content

Commit

Permalink
Empty configuration options generate <no value> string for azure-ev…
Browse files Browse the repository at this point in the history
…enthub input (#24156)

* work on no value

* changelog
  • Loading branch information
narph committed Feb 23, 2021
1 parent b8ed7f5 commit 916d4e0
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Change the `event.created` in Netflow events to be the time the event was created by Filebeat
to be consistent with ECS. {pull}23094[23094]
- Update `filestream` reader offset when a line is skipped. {pull}23417[23417]
- Add check for empty values in azure module. {pull}24156[24156]

*Filebeat*

Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/input/azureeventhub/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (conf *azureInputConfig) Validate() error {
return errors.New("no event hub name configured")
}
if conf.SAName == "" || conf.SAKey == "" {
return errors.New("missing storage account information")
return errors.New("no storage account or storage account key configured")
}
if conf.SAContainer == "" {
conf.SAContainer = fmt.Sprintf("%s-%s", ephContainerName, conf.EventHubName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
type: azure-eventhub
connection_string: {{ .connection_string }}
{{ if .eventhub }}
eventhub: {{ .eventhub }}
storage_account_container: filebeat-activitylogs-{{ .eventhub }}
{{ end }}

{{ if .connection_string }}
connection_string: {{ .connection_string }}
{{ end }}

{{ if .consumer_group }}
consumer_group: {{ .consumer_group }}
{{ end }}

{{ if .storage_account }}
storage_account: {{ .storage_account }}
{{ end }}

{{ if .storage_account_key }}
storage_account_key: {{ .storage_account_key }}
{{ end }}

{{ if .resource_manager_endpoint }}
resource_manager_endpoint: {{ .resource_manager_endpoint }}
storage_account_container: filebeat-activitylogs-{{ .eventhub }}
{{ end }}

tags: {{.tags | tojson}}
publisher_pipeline.disable_host: {{ inList .tags "forwarded" }}

Expand Down
22 changes: 20 additions & 2 deletions x-pack/filebeat/module/azure/auditlogs/config/azure-eventhub.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
type: azure-eventhub
connection_string: {{ .connection_string }}
{{ if .eventhub }}
eventhub: {{ .eventhub }}
storage_account_container: filebeat-auditlogs-{{ .eventhub }}
{{ end }}

{{ if .connection_string }}
connection_string: {{ .connection_string }}
{{ end }}

{{ if .consumer_group }}
consumer_group: {{ .consumer_group }}
{{ end }}

{{ if .storage_account }}
storage_account: {{ .storage_account }}
{{ end }}

{{ if .storage_account_key }}
storage_account_key: {{ .storage_account_key }}
{{ end }}

{{ if .resource_manager_endpoint }}
resource_manager_endpoint: {{ .resource_manager_endpoint }}
storage_account_container: filebeat-auditlogs-{{ .eventhub }}
{{ end }}

tags: {{.tags | tojson}}
publisher_pipeline.disable_host: {{ inList .tags "forwarded" }}
processors:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
type: azure-eventhub
connection_string: {{ .connection_string }}
{{ if .eventhub }}
eventhub: {{ .eventhub }}
storage_account_container: filebeat-platformlogs-{{ .eventhub }}
{{ end }}

{{ if .connection_string }}
connection_string: {{ .connection_string }}
{{ end }}

{{ if .consumer_group }}
consumer_group: {{ .consumer_group }}
{{ end }}

{{ if .storage_account }}
storage_account: {{ .storage_account }}
{{ end }}

{{ if .storage_account_key }}
storage_account_key: {{ .storage_account_key }}
{{ end }}

{{ if .resource_manager_endpoint }}
resource_manager_endpoint: {{ .resource_manager_endpoint }}
storage_account_container: filebeat-platformlogs-{{ .eventhub }}
{{ end }}

tags: {{.tags | tojson}}
publisher_pipeline.disable_host: {{ inList .tags "forwarded" }}

Expand Down
22 changes: 20 additions & 2 deletions x-pack/filebeat/module/azure/signinlogs/config/azure-eventhub.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
type: azure-eventhub
connection_string: {{ .connection_string }}
{{ if .eventhub }}
eventhub: {{ .eventhub }}
storage_account_container: filebeat-signinlogs-{{ .eventhub }}
{{ end }}

{{ if .connection_string }}
connection_string: {{ .connection_string }}
{{ end }}

{{ if .consumer_group }}
consumer_group: {{ .consumer_group }}
{{ end }}

{{ if .storage_account }}
storage_account: {{ .storage_account }}
{{ end }}

{{ if .storage_account_key }}
storage_account_key: {{ .storage_account_key }}
{{ end }}

{{ if .resource_manager_endpoint }}
resource_manager_endpoint: {{ .resource_manager_endpoint }}
storage_account_container: filebeat-signinlogs-{{ .eventhub }}
{{ end }}

tags: {{.tags | tojson}}
publisher_pipeline.disable_host: {{ inList .tags "forwarded" }}
processors:
Expand Down

0 comments on commit 916d4e0

Please sign in to comment.