Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@
- Use shorter hash for application differentiator {pull}18770[18770]
- When not port are specified and the https is used fallback to 443 {pull}18844[18844]
- Agent verifies packages before using them {pull}18876[18876]
- Change stream.* to dataset.* fields {pull}18967[18967]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ filebeat:
index: logs-generic-default
processors:
- add_fields:
target: "stream"
target: "dataset"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There a small thing missing here: dataset.dataset need to be changed for dataset.name, this will create these fields:

  1. dataset.type
  2. dataset.name
  3. dataset.namespace.

@michalpristas @ruflin The field in the agent configuration will also need to changes? Meaning we will need to adjust the index name generation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in configuration i would expect this

datasources:
  - namespace: testing
    use_output: default
    inputs:
    - type: docker/metrics
      streams:
        - metricset: status
          dataset: docker.status

to become this

datasources:
  - namespace: testing
    use_output: default
    inputs:
    - type: docker/metrics
      datasets:
        - metricset: status
          name: docker.status

is that correct?
but this feels weird as you can have

datasources:
  - namespace: testing
    use_output: default
    inputs:
    - type: docker/metrics
      datasets:
        - metricset: status
          name: docker.status
        - metricset: cpu
          name: docker.status

i dont recall if we agreed to handle configuration change as a separate pack of PRs or the same with this one @ruflin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michalpristas Please handle config changes as a separate PR as it also has effects in Kibana. I plan to open an issue for this. These config changes we should directly in combination with the potential removal of datasources.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and it does not work as expected. The result is:

          "dataset" : {
            "type" : "metrics",
            "dataset" : "system.cpu",
            "namespace" : "default"
          },

But it should be

          "dataset" : {
            "type" : "metrics",
            "name" : "system.cpu",
            "namespace" : "default"
          },

I think the reason is on line 14 where it still states dataset instead of name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right

fields:
type: logs
dataset: generic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ filebeat:
index: logs-generic-default
processors:
- add_fields:
target: "stream"
target: "dataset"
fields:
type: logs
dataset: generic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ filebeat:
index: logs-generic-default
processors:
- add_fields:
target: "stream"
target: "dataset"
fields:
type: logs
dataset: generic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ filebeat:
var: value
processors:
- add_fields:
target: "stream"
target: "dataset"
fields:
type: logs
dataset: generic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metricbeat:
hosts: ["http://127.0.0.1:8080"]
processors:
- add_fields:
target: "stream"
target: "dataset"
fields:
type: metrics
dataset: docker.status
Expand All @@ -17,7 +17,7 @@ metricbeat:
hosts: ["http://127.0.0.1:8080"]
processors:
- add_fields:
target: "stream"
target: "dataset"
fields:
type: metrics
dataset: generic
Expand All @@ -31,7 +31,7 @@ metricbeat:
fields:
should_be: first
- add_fields:
target: "stream"
target: "dataset"
fields:
type: metrics
dataset: generic
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/pkg/agent/transpiler/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,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: "stream"}})
processorMap.value = append(processorMap.value, &Key{name: "target", value: &StrVal{value: "dataset"}})
processorMap.value = append(processorMap.value, &Key{name: "fields", value: &Dict{value: []Node{
&Key{name: "type", value: &StrVal{value: r.Type}},
&Key{name: "namespace", value: &StrVal{value: namespace}},
Expand Down