diff --git a/x-pack/elastic-agent/_meta/config/common.p2.yml.tmpl b/x-pack/elastic-agent/_meta/config/common.p2.yml.tmpl index c81236e8844..e88dea9534e 100644 --- a/x-pack/elastic-agent/_meta/config/common.p2.yml.tmpl +++ b/x-pack/elastic-agent/_meta/config/common.p2.yml.tmpl @@ -17,7 +17,7 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.namespace: default + data_stream.namespace: default use_output: default streams: - metricset: cpu @@ -27,13 +27,13 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.name: system.cpu + data_stream.dataset: system.cpu - metricset: memory - dataset.name: system.memory + data_stream.dataset: system.memory - metricset: network - dataset.name: system.network + data_stream.dataset: system.network - metricset: filesystem - dataset.name: system.filesystem + data_stream.dataset: system.filesystem # agent.monitoring: # # enabled turns on monitoring of running processes diff --git a/x-pack/elastic-agent/_meta/config/common.reference.p2.yml.tmpl b/x-pack/elastic-agent/_meta/config/common.reference.p2.yml.tmpl index e0b1b26dfd9..55ed22e65a3 100644 --- a/x-pack/elastic-agent/_meta/config/common.reference.p2.yml.tmpl +++ b/x-pack/elastic-agent/_meta/config/common.reference.p2.yml.tmpl @@ -17,7 +17,7 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.namespace: default + data_stream.namespace: default use_output: default streams: - metricset: cpu @@ -27,13 +27,13 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.name: system.cpu + data_stream.dataset: system.cpu - metricset: memory - dataset.name: system.memory + data_stream.dataset: system.memory - metricset: network - dataset.name: system.network + data_stream.dataset: system.network - metricset: filesystem - dataset.name: system.filesystem + data_stream.dataset: system.filesystem # management: # # Mode of management, the Elastic Agent support two modes of operation: diff --git a/x-pack/elastic-agent/_meta/config/elastic-agent.docker.yml.tmpl b/x-pack/elastic-agent/_meta/config/elastic-agent.docker.yml.tmpl index 90e83056932..2f8187a1604 100644 --- a/x-pack/elastic-agent/_meta/config/elastic-agent.docker.yml.tmpl +++ b/x-pack/elastic-agent/_meta/config/elastic-agent.docker.yml.tmpl @@ -17,7 +17,7 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.namespace: default + data_stream.namespace: default use_output: default streams: - metricset: cpu @@ -27,13 +27,13 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.name: system.cpu + data_stream.dataset: system.cpu - metricset: memory - dataset.name: system.memory + data_stream.dataset: system.memory - metricset: network - dataset.name: system.network + data_stream.dataset: system.network - metricset: filesystem - dataset.name: system.filesystem + data_stream.dataset: system.filesystem # management: # # Mode of management, the Elastic Agent support two modes of operation: diff --git a/x-pack/elastic-agent/_meta/elastic-agent.yml b/x-pack/elastic-agent/_meta/elastic-agent.yml index b084f0661a1..eca546cec03 100644 --- a/x-pack/elastic-agent/_meta/elastic-agent.yml +++ b/x-pack/elastic-agent/_meta/elastic-agent.yml @@ -17,7 +17,7 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.namespace: default + data_stream.namespace: default use_output: default streams: - metricset: cpu @@ -27,13 +27,13 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.name: system.cpu + data_stream.dataset: system.cpu - metricset: memory - dataset.name: system.memory + data_stream.dataset: system.memory - metricset: network - dataset.name: system.network + data_stream.dataset: system.network - metricset: filesystem - dataset.name: system.filesystem + data_stream.dataset: system.filesystem # management: # # Mode of management, the Elastic Agent support two modes of operation: diff --git a/x-pack/elastic-agent/docs/elastic-agent-configuration.asciidoc b/x-pack/elastic-agent/docs/elastic-agent-configuration.asciidoc index 9dcf1dc7a5b..3392330a15e 100644 --- a/x-pack/elastic-agent/docs/elastic-agent-configuration.asciidoc +++ b/x-pack/elastic-agent/docs/elastic-agent-configuration.asciidoc @@ -93,17 +93,17 @@ filesystem metrics, and sends them to the default output. For example: ------------------------------------------------------------------------------------- inputs: - type: system/metrics - dataset.namespace: default + data_stream.namespace: default use_output: default streams: - metricset: cpu - dataset.name: system.cpu + data_stream.dataset: system.cpu - metricset: memory - dataset.name: system.memory + data_stream.dataset: system.memory - metricset: network - dataset.name: system.network + data_stream.dataset: system.network - metricset: filesystem - dataset.name: system.filesystem + data_stream.dataset: system.filesystem ------------------------------------------------------------------------------------- If `use_output` is not specified, the `default` output is used. diff --git a/x-pack/elastic-agent/docs/elastic-agent_configuration_example.yml b/x-pack/elastic-agent/docs/elastic-agent_configuration_example.yml index 5bffc62d44d..c0e21caae6e 100644 --- a/x-pack/elastic-agent/docs/elastic-agent_configuration_example.yml +++ b/x-pack/elastic-agent/docs/elastic-agent_configuration_example.yml @@ -109,7 +109,7 @@ inputs: - type: logfile name: epm/nginx version: 1.7.0 - dataset.namespace: prod + data_stream.namespace: prod # constraints are still Experimental and should not be used in production. constraints?: # Contraints look are not final @@ -120,16 +120,16 @@ inputs: streams: - id?: {id} enabled?: true # default to true - dataset.name: nginx.acccess + data_stream.dataset: nginx.acccess paths: /var/log/nginx/access.log - id?: {id} enabled?: true # default to true - dataset.name: nginx.error + data_stream.dataset: nginx.error paths: /var/log/nginx/error.log - type: nginx/metricspackage?: name: epm/nginx version: 1.7.0 - dataset.namespace: prod + data_stream.namespace: prod # constraints are still Experimental and should not be used in production. constraints?: # Contraints look are not final @@ -139,7 +139,7 @@ inputs: streams: - id?: {id} enabled?: true # default to true - dataset.name: nginx.stub_status + data_stream.dataset: nginx.stub_status metricset: stub_status ################################################################################################# @@ -148,11 +148,11 @@ inputs: - type: kafka id: kafka-x1 title: "Consume data from kafka" - dataset.namespace: prod + data_stream.namespace: prod use_output: long_term_storage host: localhost:6566 streams: - - dataset.name: foo.dataset + - data_stream.dataset: foo.dataset topic: foo processors: - extract_bro_specifics @@ -171,54 +171,54 @@ inputs: - id?: {id} enabled?: false # default true metricset: cpu - dataset.name: system.cpu + data_stream.dataset: system.cpu metrics: ["percentages", "normalized_percentages"] period: 10s - metricset: memory - dataset.name: system.memory + data_stream.dataset: system.memory period: 10s - metricset: diskio - dataset.name: system.diskio + data_stream.dataset: system.diskio period: 10s - metricset: load - dataset.name: system.load + data_stream.dataset: system.load period: 10s - metricset: memory - dataset.name: system.memory + data_stream.dataset: system.memory period: 10s - metricset: process - dataset.name: system.process + data_stream.dataset: system.process processes: ["firefox*"] include_top_n: by_cpu: 5 # include top 5 processes by CPU by_memory: 5 # include top 5 processes by memory period: 10s - metricset: process_summary - dataset.name: system.process_summary + data_stream.dataset: system.process_summary period: 10s - metricset: uptime - dataset.name: system.uptime + data_stream.dataset: system.uptime period: 15m - metricset: socket_summary - dataset.name: system.socket_summary + data_stream.dataset: system.socket_summary period: 10s - metricset: filesystem - dataset.name: system.filesystem + data_stream.dataset: system.filesystem period: 10s - metricset: raid - dataset.name: system.raid + data_stream.dataset: system.raid period: 10s - metricset: socket - dataset.name: system.socket + data_stream.dataset: system.socket period: 10s - metricset: service - dataset.name: system.service + data_stream.dataset: system.service period: 10s - metricset: fsstat - dataset.name: system.fsstat + data_stream.dataset: system.fsstat period: 10s - metricset: foo - dataset.name: system.foo + data_stream.dataset: system.foo period: 10s @@ -234,23 +234,23 @@ inputs: streams: - id?: {id} enabled?: true # default to true - dataset.name: elasticsearch.audit + data_stream.dataset: elasticsearch.audit paths: [/var/log/elasticsearch/*_access.log, /var/log/elasticsearch/*_audit.log] - id?: {id} enabled?: true - dataset.name: elasticsearch.deprecation + data_stream.dataset: elasticsearch.deprecation paths: [/var/log/elasticsearch/*_deprecation.log] - id?: {id} enabled?: true - dataset.name: elasticsearch.gc + data_stream.dataset: elasticsearch.gc paths: [/var/log/elasticsearch/*_gc.log, /var/log/elasticsearch/*_gc.log.[0-9]*] - id?: {id} enabled?: true - dataset.name: elasticsearch.server + data_stream.dataset: elasticsearch.server paths: [/var/log/elasticsearch/*.log] - id?: {id} enabled?: true - dataset.name: elasticsearch.slowlog + data_stream.dataset: elasticsearch.slowlog paths: [/var/log/elasticsearch/*_index_search_slowlog.log, /var/log/elasticsearch/*_index_indexing_slowlog.log] - type: elasticsearch/metrics id?: my-endpoint @@ -271,36 +271,36 @@ inputs: streams: - id?: {id} metricset: ccr - dataset.name: elasticseach.ccr + data_stream.dataset: elasticseach.ccr period: 10s - id?: {id} metricset: cluster_stats - dataset.name: elasticseach.cluster_stats + data_stream.dataset: elasticseach.cluster_stats period: 10s - id?: {id} metricset: enrich - dataset.name: elasticseach.enrich + data_stream.dataset: elasticseach.enrich period: 10s - id?: {id} metricset: index - dataset.name: elasticseach.index + data_stream.dataset: elasticseach.index period: 10s - id?: {id} metricset: index_recovery - dataset.name: elasticseach.index_recovery + data_stream.dataset: elasticseach.index_recovery active_only: true period: 10s - id?: {id} metricset: ml_jobs - dataset.name: elasticseach.ml_jobs + data_stream.dataset: elasticseach.ml_jobs period: 10s - id?: {id} metricset: node_stats - dataset.name: elasticseach.node_stats + data_stream.dataset: elasticseach.node_stats period: 10s - id?: {id} metricset: shard - dataset.name: elasticseach.shard + data_stream.dataset: elasticseach.shard period: 10s ################################################################################################# @@ -318,16 +318,16 @@ inputs: #shared_credential_file: /etc/filebeat/aws_credentials streams: - id?: {id} - dataset.name: aws.s3 + data_stream.dataset: aws.s3 queue_url: https://sqs.myregion.amazonaws.com/123456/sqs-queue - id?: {id} - dataset.name: aws.s3access + data_stream.dataset: aws.s3access queue_url: https://sqs.myregion.amazonaws.com/123456/sqs-queue - id?: {id} - dataset.name: aws.vpcflow + data_stream.dataset: aws.vpcflow queue_url: https://sqs.myregion.amazonaws.com/123456/sqs-queue - id?: {id} - dataset.name: aws.cloudtrail + data_stream.dataset: aws.cloudtrail queue_url: https://sqs.myregion.amazonaws.com/123456/sqs-queue - type: aws/metrics id?: my-aws @@ -343,11 +343,11 @@ inputs: streams: - id?: {id} metricset: usage - dataset.name: aws.usage + data_stream.dataset: aws.usage period: 5m - id?: {id} metricset: cloudwatch - dataset.name: aws.cloudwatch + data_stream.dataset: aws.cloudwatch period: 5m name: ["CPUUtilization", "DiskWriteOps"] resource_type: ec2:instance @@ -357,43 +357,43 @@ inputs: statistic: ["Average", "Maximum"] - id?: {id} metricset: ebs - dataset.name: aws.ebs + data_stream.dataset: aws.ebs period: 5m - id?: {id} metricset: ec2 - dataset.name: aws.ec2 + data_stream.dataset: aws.ec2 period: 5m - id?: {id} metricset: elb - dataset.name: aws.elb + data_stream.dataset: aws.elb period: 5m - id?: {id} metricset: sns - dataset.name: aws.sns + data_stream.dataset: aws.sns period: 5m - id?: {id} metricset: sqs - dataset.name: aws.sqs + data_stream.dataset: aws.sqs period: 5m - id?: {id} metricset: rds - dataset.name: aws.rds + data_stream.dataset: aws.rds period: 5m - id?: {id} metricset: billing - dataset.name: aws.billing + data_stream.dataset: aws.billing period: 12h - id?: {id} metricset: billing - dataset.name: aws.billing + data_stream.dataset: aws.billing period: 12h - id?: {id} metricset: s3_daily_storage - dataset.name: aws.s3_daily_storage + data_stream.dataset: aws.s3_daily_storage period: 24h - id?: {id} metricset: s3_request - dataset.name: aws.s3_request + data_stream.dataset: aws.s3_request period: 24h @@ -418,27 +418,27 @@ inputs: streams: - id?: {id} metricset: node - dataset.name: kubernetes.node + data_stream.dataset: kubernetes.node period: 10s - id?: {id} metricset: system - dataset.name: kubernetes.system + data_stream.dataset: kubernetes.system period: 10s - id?: {id} metricset: pod - dataset.name: kubernetes.pod + data_stream.dataset: kubernetes.pod period: 10s - id?: {id} metricset: container - dataset.name: kubernetes.container + data_stream.dataset: kubernetes.container period: 10s - id?: {id} metricset: container - dataset.name: kubernetes.container + data_stream.dataset: kubernetes.container period: 10s - id?: {id} metricset: event - dataset.name: kubernetes.event + data_stream.dataset: kubernetes.event period: 10s - type: kubernetes-state/metrics id?: my-kubernetes @@ -450,51 +450,51 @@ inputs: streams: - id?: {id} metricset: state_node - dataset.name: kubernetes.node + data_stream.dataset: kubernetes.node period: 10s - id?: {id} metricset: state_deployment - dataset.name: kubernetes.deployment + data_stream.dataset: kubernetes.deployment period: 10s - id?: {id} metricset: state_replicaset - dataset.name: kubernetes.replicaset + data_stream.dataset: kubernetes.replicaset period: 10s - id?: {id} metricset: state_statefulset - dataset.name: kubernetes.statefulset + data_stream.dataset: kubernetes.statefulset period: 10s - id?: {id} metricset: state_pod - dataset.name: kubernetes.pod + data_stream.dataset: kubernetes.pod period: 10s - id?: {id} metricset: state_container - dataset.name: kubernetes.container + data_stream.dataset: kubernetes.container period: 10s - id?: {id} metricset: state_container - dataset.name: kubernetes.container + data_stream.dataset: kubernetes.container period: 10s - id?: {id} metricset: state_cronjob - dataset.name: kubernetes.cronjob + data_stream.dataset: kubernetes.cronjob period: 10s - id?: {id} metricset: state_resourcequota - dataset.name: kubernetes.resourcequota + data_stream.dataset: kubernetes.resourcequota period: 10s - id?: {id} metricset: state_service - dataset.name: kubernetes.service + data_stream.dataset: kubernetes.service period: 10s - id?: {id} metricset: state_persistentvolume - dataset.name: kubernetes.persistentvolume + data_stream.dataset: kubernetes.persistentvolume period: 10s - id?: {id} metricset: state_persistentvolumeclaim - dataset.name: kubernetes.persistentvolumeclaim + data_stream.dataset: kubernetes.persistentvolumeclaim period: 10s ################################################################################################# @@ -517,35 +517,35 @@ inputs: streams: - id?: {id} metricset: container - dataset.name: docker.container + data_stream.dataset: docker.container period: 10s - id?: {id} metricset: cpu - dataset.name: docker.cpu + data_stream.dataset: docker.cpu period: 10s - id?: {id} metricset: diskio - dataset.name: docker.diskio + data_stream.dataset: docker.diskio period: 10s - id?: {id} metricset: event - dataset.name: docker.event + data_stream.dataset: docker.event period: 10s - id?: {id} metricset: healthcheck - dataset.name: docker.healthcheck + data_stream.dataset: docker.healthcheck period: 10s - id?: {id} metricset: info - dataset.name: docker.info + data_stream.dataset: docker.info period: 10s - id?: {id} metricset: memory - dataset.name: docker.memory + data_stream.dataset: docker.memory period: 10s - id?: {id} metricset: network - dataset.name: docker.network + data_stream.dataset: docker.network period: 10s ################################################################################################# @@ -555,14 +555,14 @@ inputs: - type: log id?: suricata-x1 title: Suricata's data - dataset.namespace: "abc" + data_stream.namespace: "abc" package: name: suricata version: x.x.x streams: - id?: {id} type: "typeX" - dataset.name: suricata.logs + data_stream.dataset: suricata.logs path: /var/log/surcata/eve.json ################################################################################################# @@ -571,7 +571,7 @@ inputs: - type: endpoint # Reserved key word id?: myendpoint-x1 title: Endpoint configuration - dataset.namespace: "canada" + data_stream.namespace: "canada" package: name: endpoint version: xxx @@ -627,7 +627,7 @@ inputs: - type: endpoint # Reserved key word id?: myendpoint-1 title: Endpoint configuration - dataset.namespace: "canada" + data_stream.namespace: "canada" package: name: epm/endpoint # This establish the link with the package and will allow to link it to endpoint app. version: xxx diff --git a/x-pack/elastic-agent/elastic-agent.docker.yml b/x-pack/elastic-agent/elastic-agent.docker.yml index 90e83056932..2f8187a1604 100644 --- a/x-pack/elastic-agent/elastic-agent.docker.yml +++ b/x-pack/elastic-agent/elastic-agent.docker.yml @@ -17,7 +17,7 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.namespace: default + data_stream.namespace: default use_output: default streams: - metricset: cpu @@ -27,13 +27,13 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.name: system.cpu + data_stream.dataset: system.cpu - metricset: memory - dataset.name: system.memory + data_stream.dataset: system.memory - metricset: network - dataset.name: system.network + data_stream.dataset: system.network - metricset: filesystem - dataset.name: system.filesystem + data_stream.dataset: system.filesystem # management: # # Mode of management, the Elastic Agent support two modes of operation: diff --git a/x-pack/elastic-agent/elastic-agent.reference.yml b/x-pack/elastic-agent/elastic-agent.reference.yml index 6e9589c3fa1..08a12d7907a 100644 --- a/x-pack/elastic-agent/elastic-agent.reference.yml +++ b/x-pack/elastic-agent/elastic-agent.reference.yml @@ -23,7 +23,7 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.namespace: default + data_stream.namespace: default use_output: default streams: - metricset: cpu @@ -33,13 +33,13 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.name: system.cpu + data_stream.dataset: system.cpu - metricset: memory - dataset.name: system.memory + data_stream.dataset: system.memory - metricset: network - dataset.name: system.network + data_stream.dataset: system.network - metricset: filesystem - dataset.name: system.filesystem + data_stream.dataset: system.filesystem # management: # # Mode of management, the Elastic Agent support two modes of operation: diff --git a/x-pack/elastic-agent/elastic-agent.yml b/x-pack/elastic-agent/elastic-agent.yml index a78b0598142..232ff03c62e 100644 --- a/x-pack/elastic-agent/elastic-agent.yml +++ b/x-pack/elastic-agent/elastic-agent.yml @@ -23,7 +23,7 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.namespace: default + data_stream.namespace: default use_output: default streams: - metricset: cpu @@ -33,13 +33,13 @@ inputs: # Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, # # Cannot start with -, _, + # Cannot be . or .. - dataset.name: system.cpu + data_stream.dataset: system.cpu - metricset: memory - dataset.name: system.memory + data_stream.dataset: system.memory - metricset: network - dataset.name: system.network + data_stream.dataset: system.network - metricset: filesystem - dataset.name: system.filesystem + data_stream.dataset: system.filesystem # agent.monitoring: # # enabled turns on monitoring of running processes diff --git a/x-pack/elastic-agent/pkg/agent/application/filters/stream_checker.go b/x-pack/elastic-agent/pkg/agent/application/filters/stream_checker.go index 470cb776ab1..3a6a7843b72 100644 --- a/x-pack/elastic-agent/pkg/agent/application/filters/stream_checker.go +++ b/x-pack/elastic-agent/pkg/agent/application/filters/stream_checker.go @@ -16,11 +16,11 @@ import ( // ErrInvalidNamespace is error returned when namespace value provided is invalid. var ErrInvalidNamespace = errors.New("provided namespace is invalid", errors.TypeConfig) -// ErrInvalidDataset is error returned when dataset name value provided is invalid. -var ErrInvalidDataset = errors.New("provided dataset name is invalid", errors.TypeConfig) +// ErrInvalidDataset is error returned when datastream name value provided is invalid. +var ErrInvalidDataset = errors.New("provided datastream dataset is invalid", errors.TypeConfig) -// ErrInvalidIndex occurs when concatenation of {dataset.type}-{dataset.name}-{dataset.namespace} does not meet index criteria. -var ErrInvalidIndex = errors.New("provided combination of type, dataset name and namespace is invalid", errors.TypeConfig) +// ErrInvalidIndex occurs when concatenation of {data_stream.type}-{data_stream.dataset}-{data_stream.namespace} does not meet index criteria. +var ErrInvalidIndex = errors.New("provided combination of type, datastream dataset and namespace is invalid", errors.TypeConfig) // StreamChecker checks for invalid values in stream namespace and dataset. func StreamChecker(log *logger.Logger, ast *transpiler.AST) error { @@ -42,9 +42,9 @@ func StreamChecker(log *logger.Logger, ast *transpiler.AST) error { for _, inputNode := range inputsNodeListCollection { namespace := "default" datasetName := "generic" - // fail only if dataset.namespace or dataset[namespace] is found and invalid + // fail only if data_stream.namespace or data_stream[namespace] is found and invalid // not provided values are ok and will be fixed by rules - if nsNode, found := inputNode.Find("dataset.namespace"); found { + if nsNode, found := inputNode.Find("data_stream.namespace"); found { nsKey, ok := nsNode.(*transpiler.Key) if ok { newNamespace := nsKey.Value().(transpiler.Node).String() @@ -54,9 +54,9 @@ func StreamChecker(log *logger.Logger, ast *transpiler.AST) error { namespace = newNamespace } } else { - dsNode, found := inputNode.Find("dataset") + dsNode, found := inputNode.Find("data_stream") if found { - // got a dataset + // got a datastream datasetMap, ok := dsNode.Value().(*transpiler.Dict) if ok { nsNode, found := datasetMap.Find("namespace") @@ -76,14 +76,14 @@ func StreamChecker(log *logger.Logger, ast *transpiler.AST) error { // get the type, longest type for now is metrics datasetType := "metrics" - if nsNode, found := inputNode.Find("dataset.type"); found { + if nsNode, found := inputNode.Find("data_stream.type"); found { nsKey, ok := nsNode.(*transpiler.Key) if ok { newDataset := nsKey.Value().(transpiler.Node).String() datasetType = newDataset } } else { - dsNode, found := inputNode.Find("dataset") + dsNode, found := inputNode.Find("data_stream") if found { // got a dataset datasetMap, ok := dsNode.Value().(*transpiler.Dict) @@ -116,7 +116,7 @@ func StreamChecker(log *logger.Logger, ast *transpiler.AST) error { } // fix this only if in compact form - if dsNameNode, found := streamMap.Find("dataset.name"); found { + if dsNameNode, found := streamMap.Find("data_stream.dataset"); found { dsKey, ok := dsNameNode.(*transpiler.Key) if ok { newDataset := dsKey.Value().(transpiler.Node).String() @@ -126,14 +126,14 @@ func StreamChecker(log *logger.Logger, ast *transpiler.AST) error { datasetName = newDataset } } else { - datasetNode, found := streamMap.Find("dataset") + datasetNode, found := streamMap.Find("data_stream") if found { datasetMap, ok := datasetNode.Value().(*transpiler.Dict) if !ok { continue } - dsNameNode, found := datasetMap.Find("name") + dsNameNode, found := datasetMap.Find("dataset") if found { dsKey, ok := dsNameNode.(*transpiler.Key) if ok { diff --git a/x-pack/elastic-agent/pkg/agent/application/filters/stream_checker_test.go b/x-pack/elastic-agent/pkg/agent/application/filters/stream_checker_test.go index b6d9bc22e0d..1daa14a1ad6 100644 --- a/x-pack/elastic-agent/pkg/agent/application/filters/stream_checker_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/filters/stream_checker_test.go @@ -40,8 +40,8 @@ func TestStreamCheck(t *testing.T) { configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ { - "dataset.namespace": "somenamespace", - "streams": []map[string]interface{}{{"dataset.name": "somedatasetname"}}, + "data_stream.namespace": "somenamespace", + "streams": []map[string]interface{}{{"data_stream.dataset": "somedatasetname"}}, }, }, }, @@ -52,13 +52,13 @@ func TestStreamCheck(t *testing.T) { configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ { - "dataset": map[string]interface{}{ + "data_stream": map[string]interface{}{ "namespace": "somenamespace", }, "streams": []map[string]interface{}{ { - "dataset": map[string]interface{}{ - "name": "somedatasetname", + "data_stream": map[string]interface{}{ + "dataset": "somedatasetname", }, }, }, @@ -68,23 +68,23 @@ func TestStreamCheck(t *testing.T) { result: nil, }, { - name: "dataset.name invalid - compact", + name: "dataset invalid - compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"streams": []map[string]interface{}{{"dataset.name": ""}}}, + {"streams": []map[string]interface{}{{"data_stream.dataset": ""}}}, }, }, result: ErrInvalidDataset, }, { - name: "dataset.name invalid - long", + name: "dataset invalid - long", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ { "streams": []map[string]interface{}{ { - "dataset": map[string]interface{}{ - "name": "", + "data_stream": map[string]interface{}{ + "dataset": "", }, }, }, @@ -95,55 +95,55 @@ func TestStreamCheck(t *testing.T) { }, { - name: "dataset.name invalid dot - compact", + name: "dataset invalid dot - compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"streams": []map[string]interface{}{{"dataset.name": "."}}}, + {"streams": []map[string]interface{}{{"data_stream.dataset": "."}}}, }, }, result: ErrInvalidDataset, }, { - name: "dataset.name invalid dotdot- compact", + name: "dataset invalid dotdot- compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"streams": []map[string]interface{}{{"dataset.name": ".."}}}, + {"streams": []map[string]interface{}{{"data_stream.dataset": ".."}}}, }, }, result: ErrInvalidDataset, }, { - name: "dataset.name invalid uppercase - compact", + name: "dataset invalid uppercase - compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"streams": []map[string]interface{}{{"dataset.name": "myNameIs"}}}, + {"streams": []map[string]interface{}{{"data_stream.dataset": "myNameIs"}}}, }, }, result: ErrInvalidDataset, }, { - name: "dataset.name invalid space- compact", + name: "dataset invalid space- compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"streams": []map[string]interface{}{{"dataset.name": "outer space"}}}, + {"streams": []map[string]interface{}{{"data_stream.dataset": "outer space"}}}, }, }, result: ErrInvalidDataset, }, { - name: "dataset.name invalid invalid char- compact", + name: "dataset invalid invalid char- compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"streams": []map[string]interface{}{{"dataset.name": "is\\thisvalid"}}}, + {"streams": []map[string]interface{}{{"data_stream.dataset": "is\\thisvalid"}}}, }, }, result: ErrInvalidDataset, }, { - name: "dataset.name invalid invalid prefix- compact", + name: "dataset invalid invalid prefix- compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"streams": []map[string]interface{}{{"dataset.name": "_isthisvalid"}}}, + {"streams": []map[string]interface{}{{"data_stream.dataset": "_isthisvalid"}}}, }, }, result: ErrInvalidDataset, @@ -152,7 +152,7 @@ func TestStreamCheck(t *testing.T) { { name: "namespace invalid - compact", configMap: map[string]interface{}{ - "inputs": []map[string]interface{}{{"dataset.namespace": ""}}, + "inputs": []map[string]interface{}{{"data_stream.namespace": ""}}, }, result: ErrInvalidNamespace, }, @@ -160,7 +160,7 @@ func TestStreamCheck(t *testing.T) { name: "namespace invalid name 1 - compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"dataset.namespace": "."}, + {"data_stream.namespace": "."}, }, }, result: ErrInvalidNamespace, @@ -168,35 +168,35 @@ func TestStreamCheck(t *testing.T) { { name: "namespace invalid name 2 - compact", configMap: map[string]interface{}{ - "inputs": []map[string]interface{}{{"dataset.namespace": ".."}}, + "inputs": []map[string]interface{}{{"data_stream.namespace": ".."}}, }, result: ErrInvalidNamespace, }, { name: "namespace invalid name uppercase - compact", configMap: map[string]interface{}{ - "inputs": []map[string]interface{}{{"dataset.namespace": "someUpper"}}, + "inputs": []map[string]interface{}{{"data_stream.namespace": "someUpper"}}, }, result: ErrInvalidNamespace, }, { name: "namespace invalid name space - compact", configMap: map[string]interface{}{ - "inputs": []map[string]interface{}{{"dataset.namespace": "some space"}}, + "inputs": []map[string]interface{}{{"data_stream.namespace": "some space"}}, }, result: ErrInvalidNamespace, }, { name: "namespace invalid name invalid char - compact", configMap: map[string]interface{}{ - "inputs": []map[string]interface{}{{"dataset.namespace": "isitok?"}}, + "inputs": []map[string]interface{}{{"data_stream.namespace": "isitok?"}}, }, result: ErrInvalidNamespace, }, { name: "namespace invalid name invalid prefix - compact", configMap: map[string]interface{}{ - "inputs": []map[string]interface{}{{"dataset.namespace": "+isitok"}}, + "inputs": []map[string]interface{}{{"data_stream.namespace": "+isitok"}}, }, result: ErrInvalidNamespace, }, @@ -205,7 +205,7 @@ func TestStreamCheck(t *testing.T) { configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ { - "dataset": map[string]interface{}{ + "data_stream": map[string]interface{}{ "namespace": "", }, }, @@ -217,7 +217,7 @@ func TestStreamCheck(t *testing.T) { name: "type invalid name 1 - compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"dataset.type": "-invalidstart"}, + {"data_stream.type": "-invalidstart"}, }, }, result: ErrInvalidIndex, @@ -227,9 +227,9 @@ func TestStreamCheck(t *testing.T) { configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ { - "dataset.type": semiLongString, - "dataset.namespace": semiLongString, - "streams": []map[string]interface{}{{"dataset.name": semiLongString}}, + "data_stream.type": semiLongString, + "data_stream.namespace": semiLongString, + "streams": []map[string]interface{}{{"data_stream.dataset": semiLongString}}, }, }, }, @@ -239,7 +239,7 @@ func TestStreamCheck(t *testing.T) { name: "type invalid type length 1 - compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"dataset.type": longString}, + {"data_stream.type": longString}, }, }, result: ErrInvalidIndex, @@ -249,17 +249,17 @@ func TestStreamCheck(t *testing.T) { name: "type invalid namespace length 1 - compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"dataset.namespace": longString}, + {"data_stream.namespace": longString}, }, }, result: ErrInvalidNamespace, }, { - name: "type invalid dataset.name length 1 - compact", + name: "type invalid dataset length 1 - compact", configMap: map[string]interface{}{ "inputs": []map[string]interface{}{ - {"streams": []map[string]interface{}{{"dataset.name": longString}}}, + {"streams": []map[string]interface{}{{"data_stream.dataset": longString}}}, }, }, result: ErrInvalidDataset, diff --git a/x-pack/elastic-agent/pkg/agent/application/managed_mode_test.go b/x-pack/elastic-agent/pkg/agent/application/managed_mode_test.go index b9e4e4b5f3c..2958a51f688 100644 --- a/x-pack/elastic-agent/pkg/agent/application/managed_mode_test.go +++ b/x-pack/elastic-agent/pkg/agent/application/managed_mode_test.go @@ -115,7 +115,7 @@ const fleetResponse = ` "streams": [{ "id": "system/metrics-system.core", "enabled": true, - "dataset.name": "system.core", + "data_stream.dataset": "system.core", "period": "10s", "metrics": [ "percentages" @@ -124,7 +124,7 @@ const fleetResponse = ` { "id": "system/metrics-system.cpu", "enabled": true, - "dataset.name": "system.cpu", + "data_stream.dataset": "system.cpu", "period": "10s", "metrics": [ "percentages", @@ -134,59 +134,59 @@ const fleetResponse = ` { "id": "system/metrics-system.diskio", "enabled": true, - "dataset.name": "system.diskio", + "data_stream.dataset": "system.diskio", "period": "10s", "include_devices": [] }, { "id": "system/metrics-system.entropy", "enabled": true, - "dataset.name": "system.entropy", + "data_stream.dataset": "system.entropy", "period": "10s", "include_devices": [] }, { "id": "system/metrics-system.filesystem", "enabled": true, - "dataset.name": "system.filesystem", + "data_stream.dataset": "system.filesystem", "period": "1m", "ignore_types": [] }, { "id": "system/metrics-system.fsstat", "enabled": true, - "dataset.name": "system.fsstat", + "data_stream.dataset": "system.fsstat", "period": "1m", "ignore_types": [] }, { "id": "system/metrics-system.load", "enabled": true, - "dataset.name": "system.load", + "data_stream.dataset": "system.load", "period": "10s" }, { "id": "system/metrics-system.memory", "enabled": true, - "dataset.name": "system.memory", + "data_stream.dataset": "system.memory", "period": "10s" }, { "id": "system/metrics-system.network", "enabled": true, - "dataset.name": "system.network", + "data_stream.dataset": "system.network", "period": "10s" }, { "id": "system/metrics-system.network_summary", "enabled": true, - "dataset.name": "system.network_summary", + "data_stream.dataset": "system.network_summary", "period": "10s" }, { "id": "system/metrics-system.process", "enabled": true, - "dataset.name": "system.process", + "data_stream.dataset": "system.process", "period": "10s", "processes": [ ".*" @@ -202,39 +202,39 @@ const fleetResponse = ` { "id": "system/metrics-system.process_summary", "enabled": true, - "dataset.name": "system.process_summary", + "data_stream.dataset": "system.process_summary", "period": "10s" }, { "id": "system/metrics-system.raid", "enabled": true, - "dataset.name": "system.raid", + "data_stream.dataset": "system.raid", "period": "10s", "mount_point": "/" }, { "id": "system/metrics-system.service", "enabled": true, - "dataset.name": "system.service", + "data_stream.dataset": "system.service", "period": "10s", "state_filter": [] }, { "id": "system/metrics-system.socket_summary", "enabled": true, - "dataset.name": "system.socket_summary", + "data_stream.dataset": "system.socket_summary", "period": "10s" }, { "id": "system/metrics-system.uptime", "enabled": true, - "dataset.name": "system.uptime", + "data_stream.dataset": "system.uptime", "period": "15m" }, { "id": "system/metrics-system.users", "enabled": true, - "dataset.name": "system.users", + "data_stream.dataset": "system.users", "period": "10s" } ] @@ -245,7 +245,7 @@ const fleetResponse = ` "streams": [{ "id": "logs-system.auth", "enabled": true, - "dataset.name": "system.auth", + "data_stream.dataset": "system.auth", "paths": [ "/var/log/auth.log*", "/var/log/secure*" @@ -254,7 +254,7 @@ const fleetResponse = ` { "id": "logs-system.syslog", "enabled": true, - "dataset.name": "system.syslog", + "data_stream.dataset": "system.syslog", "paths": [ "/var/log/messages*", "/var/log/syslog*" diff --git a/x-pack/elastic-agent/pkg/agent/program/supported.go b/x-pack/elastic-agent/pkg/agent/program/supported.go index c87ac1a427b..b72add5682d 100644 --- a/x-pack/elastic-agent/pkg/agent/program/supported.go +++ b/x-pack/elastic-agent/pkg/agent/program/supported.go @@ -20,7 +20,7 @@ func init() { // spec/endpoint.yml // spec/filebeat.yml // spec/metricbeat.yml - unpacked := packer.MustUnpack("eJy8mF1zozjWx++fj9G3z9YuiHZ22aq5sMnyZoe0SSIJ3SHJBmwJs22MDVv73bcEGIOT9EzPVM1Fyg4W0jlH5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YQuzR0QXdeqpnOmjq2R34M6qadU2jlBuhLsE0XmnrzqX1dYMemx7Dn5R1B32x+HNUd3AOiYOVHwVM+ObVN41PcE+TqpfW5Ju+aOkFHXlFsoY7VZEhzWMQp6SFtUzAgnc31XDJ1ITebqyaypV8Rt55ATsVqhVgBx2iB9mCNV4qp4E7xWs7iC07ZhruS6YoZouAPLVS5Kas1UU7hCzPI237RJ/hVfIeD1kGwMbQKDMZrtCU6uxdkK3HO2uPrYdMUsTrFs57heVPUtc/0qArBhwBwKiILZNgLmichL0UGtODEAa26bKcnDQeAGOO3zrQeGWuUORcN7EMmkWb6HhrC6PQuu9vR26il7vHuH8QEIfQIfrZBgYB+p/QnkdWffzhw16Pe+zypqzMdNTmycQDB3/eDZx2wAqLqti6KHzyFXu4FmApMZXt/ZaoQVBpeCGevpzHqFtNEdTYDzp/wY7jAjiLQC94tB8l3DxgYvuJNumYQ5wekwdHzQpGuVZzj7+n0Feh0znvY/bES/tnn9SUiGWw6EFttmTRAXG3f+x6DZ9VWNb5aP5vpbN8j97yo7Fu9j1P20ZzweEn/8nqkDulOEdDGFsH4omay9NWGl32oIvEGDnsYAbiPs19H9u5c+RwadAFCb2NXmytVmNfw//QRsjr73M3B79/7r1wJx+7kZvxf6VVB9Nwz8FHjRCVf8UOsnvXUlPxpsh775MxA37dmfv0P7TrDqq2at6vMzkJv40700amv0T8FcB3Ad+NctwP0Y5v79P/8JAAD//6EraC0=") SupportedMap = make(map[string]Spec) for f, v := range unpacked { diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config.yml index 1dce338f6b9..f4045032c07 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/constraints_config.yml @@ -24,7 +24,7 @@ inputs: - type: apache/metrics constraints: - "validate_version(%{[agent.version]}, '1.0.0 - 7.0.0')" - dataset.namespace: testing + data_stream.namespace: testing streams: - enabled: true metricset: info diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_basic-endpoint-security.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_basic-endpoint-security.yml index f1ad8c1c646..31cdc728261 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_basic-endpoint-security.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_basic-endpoint-security.yml @@ -26,7 +26,7 @@ inputs: package: name: endpoint version: 0.3.0 - dataset: + data_stream: namespace: default artifact_manifest: schema_version: v22 diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_basic.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_basic.yml index 54e3b549236..9dff3f78691 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_basic.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_basic.yml @@ -25,7 +25,7 @@ inputs: package: name: endpoint version: 0.3.0 - dataset: + data_stream: namespace: default artifact_manifest: schema_version: v22 diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_no_fleet.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_no_fleet.yml index 6a7aea5099d..8ac4e997c07 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_no_fleet.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_no_fleet.yml @@ -16,7 +16,7 @@ inputs: package: name: endpoint version: 0.3.0 - dataset: + data_stream: namespace: default artifact_manifest: schema_version: v22 diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_unknown_output.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_unknown_output.yml index 7c813b3732d..dbd492e4e25 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_unknown_output.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/endpoint_unknown_output.yml @@ -21,7 +21,7 @@ inputs: package: name: endpoint version: 0.3.0 - dataset: + data_stream: namespace: default artifact_manifest: schema_version: v22 diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-endpoint-security.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-endpoint-security.yml index 0296e357bee..4b58a1466ae 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-endpoint-security.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config-endpoint-security.yml @@ -26,7 +26,7 @@ inputs: package: name: endpoint version: 0.3.0 - dataset: + data_stream: namespace: default artifact_manifest: schema_version: v22 diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml index a4b8a8024a3..be0d2abdf02 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml @@ -29,11 +29,11 @@ inputs: use_output: default streams: - metricset: status - dataset: - name: docker.status + data_stream: + dataset: docker.status - metricset: info - dataset: - name: "" + data_stream: + dataset: "" hosts: ["http://127.0.0.1:8080"] - type: logfile use_output: default @@ -44,7 +44,7 @@ inputs: vars: var: value - type: logfile - dataset: + data_stream: type: testtype use_output: default streams: @@ -55,7 +55,7 @@ inputs: var: value - id: apache-metrics-id type: apache/metrics - dataset: + data_stream: namespace: testing use_output: default processors: @@ -73,7 +73,7 @@ inputs: package: name: endpoint version: 0.3.0 - dataset: + data_stream: namespace: default artifact_manifest: schema_version: v22 diff --git a/x-pack/elastic-agent/pkg/agent/transpiler/rules.go b/x-pack/elastic-agent/pkg/agent/transpiler/rules.go index a9fc8f4497d..cf18593c408 100644 --- a/x-pack/elastic-agent/pkg/agent/transpiler/rules.go +++ b/x-pack/elastic-agent/pkg/agent/transpiler/rules.go @@ -409,7 +409,7 @@ func (r *FixStreamRule) Apply(ast *AST) error { for _, inputNode := range inputsNodeList.value { // fix this only if in compact form - if nsNode, found := inputNode.Find("dataset.namespace"); found { + if nsNode, found := inputNode.Find("data_stream.namespace"); found { nsKey, ok := nsNode.(*Key) if ok { if newNamespace := nsKey.value.String(); newNamespace == "" { @@ -417,12 +417,12 @@ func (r *FixStreamRule) Apply(ast *AST) error { } } } else { - dsNode, found := inputNode.Find("dataset") + dsNode, found := inputNode.Find("data_stream") if found { - // got a dataset - datasetMap, ok := dsNode.Value().(*Dict) + // got a datastream + datastreamMap, ok := dsNode.Value().(*Dict) if ok { - nsNode, found := datasetMap.Find("namespace") + nsNode, found := datastreamMap.Find("namespace") if found { nsKey, ok := nsNode.(*Key) if ok { @@ -434,7 +434,7 @@ func (r *FixStreamRule) Apply(ast *AST) error { inputMap, ok := inputNode.(*Dict) if ok { inputMap.value = append(inputMap.value, &Key{ - name: "dataset.namespace", + name: "data_stream.namespace", value: &StrVal{value: defaultNamespace}, }) } @@ -444,7 +444,7 @@ func (r *FixStreamRule) Apply(ast *AST) error { inputMap, ok := inputNode.(*Dict) if ok { inputMap.value = append(inputMap.value, &Key{ - name: "dataset.namespace", + name: "data_stream.namespace", value: &StrVal{value: defaultNamespace}, }) } @@ -468,7 +468,7 @@ func (r *FixStreamRule) Apply(ast *AST) error { } // fix this only if in compact form - if dsNameNode, found := streamMap.Find("dataset.name"); found { + if dsNameNode, found := streamMap.Find("data_stream.dataset"); found { dsKey, ok := dsNameNode.(*Key) if ok { if newDataset := dsKey.value.String(); newDataset == "" { @@ -477,14 +477,14 @@ func (r *FixStreamRule) Apply(ast *AST) error { } } else { - datasetNode, found := streamMap.Find("dataset") + datastreamNode, found := streamMap.Find("data_stream") if found { - datasetMap, ok := datasetNode.Value().(*Dict) + datastreamMap, ok := datastreamNode.Value().(*Dict) if !ok { continue } - dsNameNode, found := datasetMap.Find("name") + dsNameNode, found := datastreamMap.Find("dataset") if found { dsKey, ok := dsNameNode.(*Key) if ok { @@ -494,13 +494,13 @@ func (r *FixStreamRule) Apply(ast *AST) error { } } else { streamMap.value = append(streamMap.value, &Key{ - name: "dataset.name", + name: "data_stream.dataset", value: &StrVal{value: defaultDataset}, }) } } else { streamMap.value = append(streamMap.value, &Key{ - name: "dataset.name", + name: "data_stream.dataset", value: &StrVal{value: defaultDataset}, }) } @@ -517,10 +517,10 @@ func FixStream() *FixStreamRule { } // InjectIndexRule injects index to each input. -// Index is in form {type}-{namespace}-{dataset-type} +// Index is in form {type}-{namespace}-{dataset} // type: is provided to the rule. // namespace: is collected from streams[n].namespace. If not found used 'default'. -// dataset-type: is collected from streams[n].dataset.type. If not found used 'generic'. +// dataset: is collected from streams[n].data_stream.dataset. If not found used 'generic'. type InjectIndexRule struct { Type string } @@ -538,8 +538,8 @@ func (r *InjectIndexRule) Apply(ast *AST) error { } for _, inputNode := range inputsList.value { - namespace := datasetNamespaceFromInputNode(inputNode) - datasetType := datasetTypeFromInputNode(inputNode, r.Type) + namespace := datastreamNamespaceFromInputNode(inputNode) + datastreamType := datastreamTypeFromInputNode(inputNode, r.Type) streamsNode, ok := inputNode.Find("streams") if !ok { @@ -560,7 +560,7 @@ func (r *InjectIndexRule) Apply(ast *AST) error { dataset := datasetNameFromStreamNode(streamNode) streamMap.value = append(streamMap.value, &Key{ name: "index", - value: &StrVal{value: fmt.Sprintf("%s-%s-%s", datasetType, dataset, namespace)}, + value: &StrVal{value: fmt.Sprintf("%s-%s-%s", datastreamType, dataset, namespace)}, }) } } @@ -595,8 +595,8 @@ func (r *InjectStreamProcessorRule) Apply(ast *AST) error { } for _, inputNode := range inputsList.value { - namespace := datasetNamespaceFromInputNode(inputNode) - datasetType := datasetTypeFromInputNode(inputNode, r.Type) + namespace := datastreamNamespaceFromInputNode(inputNode) + datastreamType := datastreamTypeFromInputNode(inputNode, r.Type) streamsNode, ok := inputNode.Find("streams") if !ok { @@ -636,7 +636,7 @@ func (r *InjectStreamProcessorRule) Apply(ast *AST) error { processorMap := &Dict{value: make([]Node, 0)} processorMap.value = append(processorMap.value, &Key{name: "target", value: &StrVal{value: "data_stream"}}) processorMap.value = append(processorMap.value, &Key{name: "fields", value: &Dict{value: []Node{ - &Key{name: "type", value: &StrVal{value: datasetType}}, + &Key{name: "type", value: &StrVal{value: datastreamType}}, &Key{name: "namespace", value: &StrVal{value: namespace}}, &Key{name: "dataset", value: &StrVal{value: dataset}}, }}}) @@ -1242,10 +1242,10 @@ func keys(m map[string]interface{}) []string { return keys } -func datasetNamespaceFromInputNode(inputNode Node) string { +func datastreamNamespaceFromInputNode(inputNode Node) string { const defaultNamespace = "default" - if namespaceNode, found := inputNode.Find("dataset.namespace"); found { + if namespaceNode, found := inputNode.Find("data_stream.namespace"); found { nsKey, ok := namespaceNode.(*Key) if ok { if newNamespace := nsKey.value.String(); newNamespace != "" { @@ -1254,7 +1254,7 @@ func datasetNamespaceFromInputNode(inputNode Node) string { } } - dsNode, found := inputNode.Find("dataset") + dsNode, found := inputNode.Find("data_stream") if found { dsMapNode, ok := dsNode.Value().(*Dict) if ok { @@ -1273,17 +1273,17 @@ func datasetNamespaceFromInputNode(inputNode Node) string { return defaultNamespace } -func datasetTypeFromInputNode(inputNode Node, defaultType string) string { - if dsTypeNode, found := inputNode.Find("dataset.type"); found { +func datastreamTypeFromInputNode(inputNode Node, defaultType string) string { + if dsTypeNode, found := inputNode.Find("data_stream.type"); found { dsTypeKey, ok := dsTypeNode.(*Key) if ok { - if newDatasetType := dsTypeKey.value.String(); newDatasetType != "" { - return newDatasetType + if newDatastreamType := dsTypeKey.value.String(); newDatastreamType != "" { + return newDatastreamType } } } - dsNode, found := inputNode.Find("dataset") + dsNode, found := inputNode.Find("data_stream") if found { dsMapNode, ok := dsNode.Value().(*Dict) if ok { @@ -1291,8 +1291,8 @@ func datasetTypeFromInputNode(inputNode Node, defaultType string) string { if found { typeKey, ok := typeNode.(*Key) if ok { - if newDatasetType := typeKey.value.String(); newDatasetType != "" { - return newDatasetType + if newDatastreamType := typeKey.value.String(); newDatastreamType != "" { + return newDatastreamType } } } @@ -1305,7 +1305,7 @@ func datasetTypeFromInputNode(inputNode Node, defaultType string) string { func datasetNameFromStreamNode(streamNode Node) string { const defaultDataset = "generic" - if dsNameNode, found := streamNode.Find("dataset.name"); found { + if dsNameNode, found := streamNode.Find("data_stream.dataset"); found { dsNameKey, ok := dsNameNode.(*Key) if ok { if newDatasetName := dsNameKey.value.String(); newDatasetName != "" { @@ -1314,11 +1314,11 @@ func datasetNameFromStreamNode(streamNode Node) string { } } - dsNode, found := streamNode.Find("dataset") + dsNode, found := streamNode.Find("data_stream") if found { dsMapNode, ok := dsNode.Value().(*Dict) if ok { - dsNameNode, found := dsMapNode.Find("name") + dsNameNode, found := dsMapNode.Find("dataset") if found { dsKey, ok := dsNameNode.(*Key) if ok { diff --git a/x-pack/elastic-agent/pkg/agent/transpiler/rules_test.go b/x-pack/elastic-agent/pkg/agent/transpiler/rules_test.go index 5619d847de6..c3207f48cea 100644 --- a/x-pack/elastic-agent/pkg/agent/transpiler/rules_test.go +++ b/x-pack/elastic-agent/pkg/agent/transpiler/rules_test.go @@ -31,59 +31,59 @@ inputs: - paths: /var/log/mysql/error.log - name: Specified namespace type: file - dataset.namespace: nsns + data_stream.namespace: nsns streams: - paths: /var/log/mysql/error.log - name: Specified dataset type: file streams: - paths: /var/log/mysql/error.log - dataset.name: dsds + data_stream.dataset: dsds - name: All specified type: file - dataset.namespace: nsns + data_stream.namespace: nsns streams: - paths: /var/log/mysql/error.log - dataset.name: dsds + data_stream.dataset: dsds - name: All specified with empty strings type: file - dataset.namespace: "" + data_stream.namespace: "" streams: - paths: /var/log/mysql/error.log - dataset.name: "" + data_stream.dataset: "" `, expectedYAML: ` inputs: - name: All default type: file - dataset.namespace: default + data_stream.namespace: default streams: - paths: /var/log/mysql/error.log - dataset.name: generic + data_stream.dataset: generic - name: Specified namespace type: file - dataset.namespace: nsns + data_stream.namespace: nsns streams: - paths: /var/log/mysql/error.log - dataset.name: generic + data_stream.dataset: generic - name: Specified dataset type: file - dataset.namespace: default + data_stream.namespace: default streams: - paths: /var/log/mysql/error.log - dataset.name: dsds + data_stream.dataset: dsds - name: All specified type: file - dataset.namespace: nsns + data_stream.namespace: nsns streams: - paths: /var/log/mysql/error.log - dataset.name: dsds + data_stream.dataset: dsds - name: All specified with empty strings type: file - dataset.namespace: default + data_stream.namespace: default streams: - paths: /var/log/mysql/error.log - dataset.name: generic + data_stream.dataset: generic `, rule: &RuleList{ Rules: []Rule{ @@ -101,7 +101,7 @@ inputs: - paths: /var/log/mysql/error.log - name: Specified namespace type: file - dataset.namespace: nsns + data_stream.namespace: nsns streams: - paths: /var/log/mysql/error.log @@ -109,19 +109,19 @@ inputs: type: file streams: - paths: /var/log/mysql/error.log - dataset.name: dsds + data_stream.dataset: dsds - name: All specified type: file - dataset.namespace: nsns + data_stream.namespace: nsns streams: - paths: /var/log/mysql/error.log - dataset.name: dsds + data_stream.dataset: dsds - name: All specified with empty strings type: file - dataset.namespace: "" + data_stream.namespace: "" streams: - paths: /var/log/mysql/error.log - dataset.name: "" + data_stream.dataset: "" `, expectedYAML: ` inputs: @@ -132,7 +132,7 @@ inputs: index: mytype-generic-default - name: Specified namespace type: file - dataset.namespace: nsns + data_stream.namespace: nsns streams: - paths: /var/log/mysql/error.log index: mytype-generic-nsns @@ -141,21 +141,21 @@ inputs: type: file streams: - paths: /var/log/mysql/error.log - dataset.name: dsds + data_stream.dataset: dsds index: mytype-dsds-default - name: All specified type: file - dataset.namespace: nsns + data_stream.namespace: nsns streams: - paths: /var/log/mysql/error.log - dataset.name: dsds + data_stream.dataset: dsds index: mytype-dsds-nsns - name: All specified with empty strings type: file - dataset.namespace: "" + data_stream.namespace: "" streams: - paths: /var/log/mysql/error.log - dataset.name: "" + data_stream.dataset: "" index: mytype-generic-default `, rule: &RuleList{ diff --git a/x-pack/elastic-agent/spec/filebeat.yml b/x-pack/elastic-agent/spec/filebeat.yml index f9dc8bb4507..1e477bb218f 100644 --- a/x-pack/elastic-agent/spec/filebeat.yml +++ b/x-pack/elastic-agent/spec/filebeat.yml @@ -49,11 +49,11 @@ rules: - remove_key: key: use_output - remove_key: - key: dataset + key: data_stream - remove_key: - key: dataset.namespace + key: data_stream.namespace - remove_key: - key: dataset.name + key: data_stream.dataset - filter_values: selector: inputs diff --git a/x-pack/elastic-agent/spec/metricbeat.yml b/x-pack/elastic-agent/spec/metricbeat.yml index fcc8428517a..1546e67f32d 100644 --- a/x-pack/elastic-agent/spec/metricbeat.yml +++ b/x-pack/elastic-agent/spec/metricbeat.yml @@ -65,11 +65,11 @@ rules: - remove_key: key: enabled - remove_key: - key: dataset + key: data_stream - remove_key: - key: dataset.name + key: data_stream.dataset - remove_key: - key: dataset.namespace + key: data_stream.namespace - remove_key: key: use_output