-
Notifications
You must be signed in to change notification settings - Fork 600
[Logstash] Add CEL native data collection, and dashboards for Pipeline and Pipeline Details #8098
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
Changes from 9 commits
add3b53
675d778
a13ff6b
f2584d1
55b7bb1
780f665
e5d96f0
f801aa7
48bd0e8
f2c8d43
0d6b939
596f0d8
7909f7e
8cb394b
3e71129
ad027b3
a4ba6b4
400ab49
4fa4eac
ffd380c
7c2e47e
d47de67
637eda9
2e934fc
559a8ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| type: cel | ||
| dataset: logstash.node | ||
| vars: | ||
| url: | ||
| - "http://{{Hostname}}:9600" | ||
| data_stream: ~ |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,71 @@ | ||||||||||||||
| config_version: "2" | ||||||||||||||
| interval: {{period}} | ||||||||||||||
| resource.url: "{{url}}/_node/stats?graph=true" | ||||||||||||||
| {{#if resource_ssl}} | ||||||||||||||
| resource.ssl: | ||||||||||||||
| {{resource_ssl}} | ||||||||||||||
| {{/if}} | ||||||||||||||
|
|
||||||||||||||
| state: | ||||||||||||||
| username: {{username}} | ||||||||||||||
| password: {{password}} | ||||||||||||||
|
|
||||||||||||||
| redact: | ||||||||||||||
| fields: ~ | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But if you switch to using |
||||||||||||||
|
|
||||||||||||||
| program: | | ||||||||||||||
| (has(state.username) && state.username != null ? | ||||||||||||||
| get_request(state.url).with({ | ||||||||||||||
| "Header":{ | ||||||||||||||
| "Authorization": ["Basic "+string(base64(state.username+":"+state.password))], | ||||||||||||||
| } | ||||||||||||||
| }) | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be done more easily withe the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there something I am missing beyond adding I have tried this a number of times, and I've never seen the |
||||||||||||||
| : (has(state.cursor) && has(state.cursor.username) && state.cursor.username != null ? | ||||||||||||||
| get_request(state.url).with({ | ||||||||||||||
| "Header":{ | ||||||||||||||
| "Authorization": ["Basic "+string(base64(state.cursor.username+":"+state.cursor.password))], | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| ) | ||||||||||||||
| : | ||||||||||||||
| get_request(state.url) | ||||||||||||||
| ) | ||||||||||||||
| ) | ||||||||||||||
| .do_request().as(resp, bytes(resp.Body) | ||||||||||||||
| .decode_json() | ||||||||||||||
| .as(body, | ||||||||||||||
| {"logstash":{"node":{"stats":{ | ||||||||||||||
| "events":body['events'], | ||||||||||||||
| "jvm":{ | ||||||||||||||
| "uptime_in_millis":body['jvm']['uptime_in_millis'], | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These and below can be dotted, eg:
Suggested change
Stylistic only, but slightly lighter on the page. |
||||||||||||||
| "mem":body['jvm']['mem'].drop("pools"), | ||||||||||||||
| "threads":body['jvm']['threads'] | ||||||||||||||
| }, | ||||||||||||||
| "queue":body['queue'], | ||||||||||||||
| "reloads":body['reloads'], | ||||||||||||||
| "process":body['process'], | ||||||||||||||
| "os":{ | ||||||||||||||
| "cpu":body['process']['cpu'], | ||||||||||||||
| "cgroup":has(body.os.group) ? body['os']['cgroup'] : {}, | ||||||||||||||
| }, | ||||||||||||||
| "logstash":{ | ||||||||||||||
| "ephemeral_id":body['ephemeral_id'], | ||||||||||||||
| "host":body['host'], | ||||||||||||||
| "http_address":body['http_address'], | ||||||||||||||
| "name":body['name'], | ||||||||||||||
| "pipeline":body['pipeline'], | ||||||||||||||
| "pipelines":body['pipelines'].map(pipeline, [pipeline]).flatten(), | ||||||||||||||
| "snapshot":body['snapshot'], | ||||||||||||||
| "status":body['status'], | ||||||||||||||
| "uuid":body['id'], | ||||||||||||||
| "version":body['version'], | ||||||||||||||
| } | ||||||||||||||
| }} | ||||||||||||||
| }}) | ||||||||||||||
| ) | ||||||||||||||
| .as(eve, { | ||||||||||||||
| "events":eve.map(each, eve), | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the intention here? It looks to me like you are wanting a single element array with
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case, yes - your suggestion works perfectly |
||||||||||||||
| "cursor": {"username":(has(state.cursor) && has(state.cursor.username)) ? state.cursor.username : has(state.username) ? state.username : null, | ||||||||||||||
| "password":has(state.cursor) && has(state.cursor.password) ? state.cursor.password : has(state.password) ? state.password : null | ||||||||||||||
| }, | ||||||||||||||
| }) | ||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,141 @@ | ||||||||||||||
| - name: cloud | ||||||||||||||
| title: Cloud | ||||||||||||||
| group: 2 | ||||||||||||||
| description: Fields related to the cloud or infrastructure the events are coming from. | ||||||||||||||
| footnote: "Examples: If Metricbeat is running on an EC2 host and fetches data from its host, the cloud info contains the data about this machine. If Metricbeat runs on a remote machine outside the cloud and fetches data from a service running in the cloud, the field contains cloud data from the machine the service is running on." | ||||||||||||||
| type: group | ||||||||||||||
| fields: | ||||||||||||||
| - name: account.id | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: "The cloud account or organization id used to identify different entities in a multi-tenant environment.\nExamples: AWS account id, Google Cloud ORG Id, or other unique identifier." | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A lot of these fields exist in ECS and should use
Suggested change
I've been working on a tool to fix this automatically. This command will edit the file for you. (I would only use it on a clean workspace so you can review its edits in isolation.)
|
||||||||||||||
| - name: availability_zone | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Availability zone in which this host is running. | ||||||||||||||
| - name: instance.id | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Instance ID of the host machine. | ||||||||||||||
| - name: instance.name | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Instance name of the host machine. | ||||||||||||||
| - name: machine.type | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Machine type of the host machine. | ||||||||||||||
| - name: provider | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Name of the cloud provider. Example values are aws, azure, gcp, or digitalocean. | ||||||||||||||
| - name: region | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Region in which this host is running. | ||||||||||||||
| - name: project.id | ||||||||||||||
| type: keyword | ||||||||||||||
| description: Name of the project in Google Cloud. | ||||||||||||||
| - name: image.id | ||||||||||||||
| type: keyword | ||||||||||||||
| description: Image ID for the cloud instance. | ||||||||||||||
| - name: container | ||||||||||||||
| title: Container | ||||||||||||||
| group: 2 | ||||||||||||||
| description: "Container fields are used for meta information about the specific container that is the source of information.\nThese fields help correlate data based containers from any runtime." | ||||||||||||||
| type: group | ||||||||||||||
| fields: | ||||||||||||||
| - name: id | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Unique container id. | ||||||||||||||
| - name: image.name | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Name of the image the container was built on. | ||||||||||||||
| - name: labels | ||||||||||||||
| type: object | ||||||||||||||
| object_type: keyword | ||||||||||||||
| description: Image labels. | ||||||||||||||
| - name: name | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Container name. | ||||||||||||||
| - name: host | ||||||||||||||
| title: Host | ||||||||||||||
| group: 2 | ||||||||||||||
| description: "A host is defined as a general computing instance.\nECS host.* fields should be populated with details about the host on which the event happened, or from which the measurement was taken. Host types include hardware, virtual machines, Docker containers, and Kubernetes nodes." | ||||||||||||||
| type: group | ||||||||||||||
| fields: | ||||||||||||||
| - name: architecture | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Operating system architecture. | ||||||||||||||
| - name: domain | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: "Name of the domain of which the host is a member.\nFor example, on Windows this could be the host's Active Directory domain or NetBIOS domain name. For Linux this could be the domain of the host's LDAP provider." | ||||||||||||||
| default_field: false | ||||||||||||||
| - name: hostname | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: "Hostname of the host.\nIt normally contains what the `hostname` command returns on the host machine." | ||||||||||||||
| - name: id | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: "Unique host id.\nAs hostname is not always unique, use values that are meaningful in your environment.\nExample: The current usage of `beat.name`." | ||||||||||||||
| - name: ip | ||||||||||||||
| type: ip | ||||||||||||||
| description: Host ip addresses. | ||||||||||||||
| - name: mac | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Host mac addresses. | ||||||||||||||
| - name: name | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This field is already declared in ecs.yml. |
||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: "Name of the host.\nIt can contain what `hostname` returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use." | ||||||||||||||
| - name: os.family | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: OS family (such as redhat, debian, freebsd, windows). | ||||||||||||||
| - name: os.kernel | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Operating system kernel version as a raw string. | ||||||||||||||
| - name: os.name | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| multi_fields: | ||||||||||||||
| - name: text | ||||||||||||||
| type: text | ||||||||||||||
| norms: false | ||||||||||||||
| default_field: false | ||||||||||||||
| description: Operating system name, without the version. | ||||||||||||||
| - name: os.platform | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Operating system platform (such centos, ubuntu, windows). | ||||||||||||||
| - name: os.version | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: Operating system version as a raw string. | ||||||||||||||
| - name: type | ||||||||||||||
| type: keyword | ||||||||||||||
| ignore_above: 1024 | ||||||||||||||
| description: "Type of host.\nFor Cloud providers this can be the machine type like `t2.medium`. If vm, this could be the container, for example, or other information meaningful in your environment." | ||||||||||||||
| - name: containerized | ||||||||||||||
| type: boolean | ||||||||||||||
| description: > | ||||||||||||||
| If the host is a container. | ||||||||||||||
|
|
||||||||||||||
| - name: os.build | ||||||||||||||
| type: keyword | ||||||||||||||
| description: > | ||||||||||||||
| OS build information. | ||||||||||||||
|
|
||||||||||||||
| - name: os.codename | ||||||||||||||
| type: keyword | ||||||||||||||
| description: > | ||||||||||||||
| OS codename, if any. | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| - name: data_stream.type | ||
| type: constant_keyword | ||
| description: Data stream type. | ||
| - name: data_stream.dataset | ||
| type: constant_keyword | ||
| description: Data stream dataset. | ||
| - name: data_stream.namespace | ||
| type: constant_keyword | ||
| description: Data stream namespace. | ||
| - name: service.hostname | ||
| type: keyword | ||
| description: Hostname of the service |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| - name: '@timestamp' | ||
| external: ecs | ||
| - name: service.id | ||
| external: ecs | ||
| - name: service.type | ||
| external: ecs | ||
| - name: service.version | ||
| external: ecs | ||
| - name: service.address | ||
| type: keyword | ||
| description: Address where data about this service was collected from. | ||
| - name: service.name | ||
| external: ecs | ||
| - name: process.pid | ||
| external: ecs | ||
| - name: ecs.version | ||
| external: ecs | ||
| - name: event.dataset | ||
| external: ecs | ||
| - name: event.duration | ||
| external: ecs | ||
| - name: event.module | ||
| external: ecs | ||
| - name: host.name | ||
| external: ecs | ||
| - name: error.message | ||
| external: ecs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My personal preference is to name this file based on the input type used like
cel.yml.hbs. If you do so, then update thetemplate_pathattribute in the manifest.yml.