Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add groks to parse resource_id field
- Loading branch information
1 parent
64ed7ab
commit b9ef763
Showing
7 changed files
with
189 additions
and
26 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
100 changes: 100 additions & 0 deletions
100
...work_watcher_vnet/data_stream/log/elasticsearch/ingest_pipeline/azure_shared_pipeline.yml
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,100 @@ | ||
--- | ||
description: Pipeline for parsing Azure shared log fields. | ||
processors: | ||
- set: | ||
field: cloud.provider | ||
tag: set_cloud_provider | ||
value: azure | ||
- grok: | ||
field: azure_network_watcher_vnet.log.flow_log.resource_id | ||
tag: extracts_values_flow_log_resource_id_if_subscription_id_resource_group_provider_namespace_authorization_rule_present | ||
patterns: | ||
- /SUBSCRIPTIONS/%{SUBID:azure.subscription_id}/RESOURCEGROUPS/%{GROUPID:azure.resource.group}/PROVIDERS/%{PROVIDERNAME:azure.resource.provider}/NAMESPACES/%{NAMESPACE:azure.resource.namespace}/AUTHORIZATIONRULES/%{RULE:azure.resource.authorization_rule} | ||
- /subscriptions/%{SUBID:azure.subscription_id}/resourceGroups/%{GROUPID:azure.resource.group}/providers/%{PROVIDERNAME:azure.resource.provider}/namespaces/%{NAMESPACE:azure.resource.namespace}/authorizationRules/%{RULE:azure.resource.authorization_rule} | ||
pattern_definitions: | ||
SUBID: (\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1} | ||
GROUPID: .+ | ||
PROVIDERNAME: .+ | ||
NAMESPACE: .+ | ||
RULE: .+ | ||
ignore_failure: true | ||
- grok: | ||
field: azure_network_watcher_vnet.log.flow_log.resource_id | ||
if: "ctx.azure?.subscription_id == null" | ||
tag: extracts_values_flow_log_resource_id_if_subscription_id_resource_group_provider_name_present | ||
patterns: | ||
- /SUBSCRIPTIONS/%{SUBID:azure.subscription_id}/RESOURCEGROUPS/%{GROUPID:azure.resource.group}/PROVIDERS/%{PROVIDERNAME:azure.resource.provider}/%{NAME:azure.resource.name} | ||
- /subscriptions/%{SUBID:azure.subscription_id}/resourceGroups/%{GROUPID:azure.resource.group}/providers/%{PROVIDERNAME:azure.resource.provider}/%{NAME:azure.resource.name} | ||
pattern_definitions: | ||
SUBID: (\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1} | ||
GROUPID: .+ | ||
PROVIDERNAME: ([A-Za-z])\w+.([A-Za-z])\w+/([A-Za-z])\w+. | ||
NAME: ((?!AUTHORIZATIONRULES).)*$ | ||
ignore_failure: true | ||
- grok: | ||
field: azure_network_watcher_vnet.log.flow_log.resource_id | ||
if: "ctx.azure?.subscription_id == null" | ||
tag: extracts_values_flow_log_resource_id_if_subscription_id_resource_group_provider_name_present | ||
patterns: | ||
- /SUBSCRIPTIONS/%{SUBID:azure.subscription_id}/RESOURCEGROUPS/%{GROUPID:azure.resource.group}/PROVIDERS/%{PROVIDERNAME:azure.resource.provider}/%{NAME:azure.resource.name} | ||
- /subscriptions/%{SUBID:azure.subscription_id}/resourceGroups/%{GROUPID:azure.resource.group}/providers/%{PROVIDERNAME:azure.resource.provider}/%{NAME:azure.resource.name} | ||
pattern_definitions: | ||
SUBID: (\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1} | ||
GROUPID: .+ | ||
PROVIDERNAME: ([A-Za-z])\w+.([A-Za-z])\w+\/([A-Za-z][^\/])\w+ | ||
NAME: .+ | ||
ignore_failure: true | ||
- grok: | ||
field: azure_network_watcher_vnet.log.flow_log.resource_id | ||
if: "ctx.azure?.subscription_id == null" | ||
tag: extracts_values_flow_log_resource_id_if_resource_provider_present | ||
patterns: | ||
- /providers/%{PROVIDER:azure.resource.provider} | ||
- /PROVIDERS/%{PROVIDER:azure.resource.provider} | ||
pattern_definitions: | ||
PROVIDER: .+ | ||
ignore_failure: true | ||
- grok: | ||
field: azure_network_watcher_vnet.log.flow_log.resource_id | ||
if: "ctx.azure?.subscription_id == null" | ||
tag: extracts_values_flow_log_resource_id_if_sbscription_id_resource_provider_present | ||
patterns: | ||
- /SUBSCRIPTIONS/%{SUBID:azure.subscription_id}/PROVIDERS/%{PROVIDERNAME:azure.resource.provider} | ||
- /subscriptions/%{SUBID:azure.subscription_id}/providers/%{PROVIDERNAME:azure.resource.provider} | ||
pattern_definitions: | ||
SUBID: (\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1} | ||
PROVIDERNAME: ([A-Za-z])\w+.([A-Za-z])\w+\/([A-Za-z][^\/])\w+ | ||
ignore_failure: true | ||
- grok: | ||
field: azure_network_watcher_vnet.log.flow_log.resource_id | ||
if: "ctx.azure?.subscription_id == null" | ||
tag: extracts_values_flow_log_resource_id_if_sbscription_id_resource_group_present | ||
patterns: | ||
- /SUBSCRIPTIONS/%{SUBID:azure.subscription_id}/RESOURCEGROUPS/%{GROUPID:azure.resource.group} | ||
- /subscriptions/%{SUBID:azure.subscription_id}/resourceGroups/%{GROUPID:azure.resource.group} | ||
pattern_definitions: | ||
SUBID: (\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1} | ||
GROUPID: .+ | ||
ignore_failure: true | ||
- grok: | ||
field: azure_network_watcher_vnet.log.flow_log.resource_id | ||
if: "ctx.azure?.subscription_id == null" | ||
tag: extracts_values_flow_log_resource_id_if_sbscription_id_present | ||
patterns: | ||
- /SUBSCRIPTIONS/%{SUBID:azure.subscription_id} | ||
- /subscriptions/%{SUBID:azure.subscription_id} | ||
pattern_definitions: | ||
SUBID: (\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1} | ||
ignore_failure: true | ||
- set: | ||
field: azure.resource.id | ||
tag: set_azure_resource_id_from_flow_log_resource_id | ||
copy_from: azure_network_watcher_vnet.log.flow_log.resource_id | ||
ignore_empty_value: true | ||
on_failure: | ||
- append: | ||
field: error.message | ||
value: "Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.on_failure_pipeline}}} failed with message: {{{_ingest.on_failure_message}}}" | ||
- set: | ||
field: event.kind | ||
value: pipeline_error |
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
39 changes: 39 additions & 0 deletions
39
packages/azure_network_watcher_vnet/data_stream/log/fields/package-fields.yml
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,39 @@ | ||
- name: azure | ||
type: group | ||
fields: | ||
- name: resource | ||
type: group | ||
fields: | ||
- name: group | ||
type: keyword | ||
description: Resource group. | ||
- name: id | ||
type: keyword | ||
description: Resource ID. | ||
- name: name | ||
type: keyword | ||
description: Name. | ||
- name: provider | ||
type: keyword | ||
description: Resource type/namespace. | ||
- name: storage | ||
type: group | ||
fields: | ||
- name: blob | ||
type: group | ||
fields: | ||
- name: content_type | ||
type: keyword | ||
description: The content type of the Azure Blob Storage blob object. | ||
- name: name | ||
type: keyword | ||
description: The name of the Azure Blob Storage blob object. | ||
- name: container | ||
type: group | ||
fields: | ||
- name: name | ||
type: keyword | ||
description: The name of the Azure Blob Storage container. | ||
- name: subscription_id | ||
type: keyword | ||
description: Azure subscription ID. |
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