Skip to content

Rally benchmark aws.ec2 logs #8416

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

Merged
merged 10 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 14 additions & 0 deletions packages/aws/_dev/benchmark/rally/ec2logs-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Benchmark 20000 aws.ec2_logs events ingested
data_stream:
name: ec2_logs
corpora:
generator:
total_events: 20000
template:
type: gotext
path: ./ec2logs-benchmark/template.ndjson
config:
path: ./ec2logs-benchmark/config.yml
fields:
path: ./ec2logs-benchmark/fields.yml
16 changes: 16 additions & 0 deletions packages/aws/_dev/benchmark/rally/ec2logs-benchmark/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
fields:
- name: 'timestamp'
period: -24h # one day
- name: process.name
enum: ["journal", "kernel", "systemd"]
- name: agent.id
value: "da6cb4c8-c84c-4c5f-97c7-f8586a098af4"
- name: cloud.region
enum: ["us-east-1", "us-east-2", "us-west-1", "us-west-2", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", "sa-east-1", "af-south-1", "ap-east-1", "ap-south-2", "ap-southeast-3", "eu-south-2", "eu-central-2", "me-south-1", "me-central-1"]
cardinality: 100
Copy link
Contributor

Choose a reason for hiding this comment

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

same question here as in the other PR - how can a field have cardinality of 100, when it has fewer possible values?

Copy link
Contributor

Choose a reason for hiding this comment

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

wanted to follow up on this cardinality value - where does 100 come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just want to have 100 ec2 instances (aws.cloudwatch.log_stream/host.name/aws.ec2.ip_address): since cloud.region is an enum with length 25, 100 itself is the LCM

Copy link
Contributor

Choose a reason for hiding this comment

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

so if you didn't specify this - you would end up with 25 unique instances? by specifying this, for each region, you generate 4 unique values of the log_stream, host.name and ip_address, resulting in 100 unique instances?

- name: aws.cloudwatch.log_stream
cardinality: 100
- name: host.name
cardinality: 100
- name: aws.ec2.ip_address
cardinality: 100
20 changes: 20 additions & 0 deletions packages/aws/_dev/benchmark/rally/ec2logs-benchmark/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- name: timestamp
type: date
- name: process.name
type: keyword
- name: event.ingested
type: date
- name: aws.ec2.ip_address
type: ip
- name: message
type: text
- name: aws.cloudwatch.log_stream
type: keyword
- name: host.name
type: keyword
- name: agent.id
type: keyword
- name: event.id
type: keyword
- name: cloud.region
type: keyword
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{{- $timestamp := generate "timestamp" }}
{{- $ip := generate "aws.ec2.ip_address" }}
{{- $pname := generate "process.name" }}
{{- $logstream := generate "aws.cloudwatch.log_stream" }}
{{- $hostname := generate "host.name" }}
{{- $agentId := generate "agent.id" }}
{
"@timestamp": "{{ $timestamp.Format "2006-01-02T15:04:05.999999Z07:00" }}",
"aws.cloudwatch": {
"log_stream": "{{$logstream}}",
"ingestion_time": "{{ $timestamp | date "2006-01-02T15:04:05.000Z" }}",
"log_group": "/var/log/messages"
},
"cloud": {
"region": "{{ generate "cloud.region" }}"
},
"log.file.path": "/var/log/messages/{{$logstream}}",
"input": {
"type": "aws-cloudwatch"
},
"data_stream": {
"namespace": "ep",
"type": "logs",
"dataset": "aws.ec2_logs"
},
"process": {
"name": "{{ $pname }}"
},
"message": "{{$timestamp | date "2006-01-02T15:04:05.000Z"}} {{$timestamp | date "Jan"}} {{$timestamp | date "02"}} {{$timestamp | date "15:04:05"}} {{printf "ip-%s" ($ip | splitList "." | join "-")}} {{$pname}}: {{generate "message"}}",
"event": {
"id": "{{ generate "event.id" }}",
"ingested": "{{ generate "event.ingested" | date "2006-01-02T15:04:05.000000000Z" }}",
"dataset": "aws.ec2_logs"
},
"host": {
"name": "{{$hostname}}"
},
"agent": {
"id": "{{$agentId}}",
"name": "{{$hostname}}",
"type": "filebeat",
"version": "8.8.0",
"ephemeral_id": "{{$agentId}}"
},
"tags": [
"preserve_original_event"
]
}