Skip to content

Commit

Permalink
rally benchmark nginx.access
Browse files Browse the repository at this point in the history
  • Loading branch information
ali786XI committed Feb 1, 2024
1 parent 35ae7e2 commit 4d92587
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/nginx/_dev/benchmark/rally/access-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Benchmark 20000 nginx.access events ingested
data_stream:
name: access
corpora:
generator:
total_events: 20000
template:
type: gotext
path: ./access-benchmark/template.ndjson
config:
path: ./access-benchmark/config.yml
fields:
path: ./access-benchmark/fields.yml
15 changes: 15 additions & 0 deletions packages/nginx/_dev/benchmark/rally/access-benchmark/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
fields:
- name: 'timestamp'
period: -24h # one day
- name: agent.id
value: "ef5e274d-4b53-45e6-943a-a5bcf1a6f523"
- name: request_method
enum: ["GET", "POST", "PUT", "DELETE"]
- name: status_code
enum: ["101", "102", "200", "201", "202", "300", "301", "302", "400", "401", "402", "500", "501"]
- name: response_bytes
range:
min: 100
max: 30000
- name: id
enum: ["1", "2", "3"]
23 changes: 23 additions & 0 deletions packages/nginx/_dev/benchmark/rally/access-benchmark/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- name: agent.ephemeral_id
type: keyword
- name: agent.id
type: keyword
- name: agent.name
type: keyword
- name: destination_domain
type: keyword
example: lessons.example.com
- name: remote_ip
type: ip
- name: timestamp
type: date
- name: request_method
type: keyword
- name: status_code
type: keyword
- name: response_bytes
type: long
- name: remote_user
type: keyword
- name: id
type: keyword
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{{- $timestamp := generate "timestamp" }}
{{- $agentId := generate "agent.id" }}
{{- $agentName := generate "agent.name" }}
{{- $agentEphemeralid := generate "agent.ephemeral_id" }}
{{- $destinationDomain := generate "destination_domain" }}
{{- $remoteIp := generate "remote_ip" }}
{{- $remoteUser := generate "remote_user" }}
{{- $requestMethod := generate "request_method" }}
{{- $statusCode := generate "status_code" }}
{{- $responseBytes := generate "response_bytes" }}
{{- $id := generate "id" }}
{
"@timestamp": "{{ $timestamp.Format "2006-01-02T15:04:05.000Z07:00" }}",
"agent": {
"ephemeral_id": "{{ $agentEphemeralid }}",
"id": "{{ $agentId }}",
"name": "{{ $agentName }}",
"type": "filebeat",
"version": "8.5.1"
},
"data_stream": {
"dataset": "nginx.access",
"namespace": "ep",
"type": "logs"
},
"ecs": {
"version": "8.5.1"
},
"elastic_agent": {
"id": "{{ $agentId }}",
"snapshot": false,
"version": "8.5.0"
},
"message": "{{ $destinationDomain }}:80 {{ $remoteIp }} - {{ $remoteUser }} [{{$timestamp | date "02/Jan/2006:15:04:05"}} {{ $timestamp.Format "Z0700" }}] \"{{$requestMethod}} /downloads/product_{{ $id }} HTTP/1.1\" {{ $statusCode }} {{ $responseBytes }} \"http://localhost:8080/\" \"Chef Client/12.0.3 (ruby-2.1.4-p265; ohai-8.0.1; x86_64-linux; +http://opscode.com)\"",
"event": {
"agent_id_status": "verified",
"dataset": "nginx.access",
"timezone": "{{ $timestamp.Format "-07:00" }}"
},
"host": {
"architecture": "x86_64",
"containerized": false,
"hostname": "docker-fleet-agent",
"id": "66392b0697b84641af8006d87aeb89f1",
"ip": [
"172.18.0.7"
],
"mac": [
"02-42-AC-12-00-07"
],
"name": "docker-fleet-agent",
"os": {
"codename": "focal",
"family": "debian",
"kernel": "5.15.49-linuxkit",
"name": "Ubuntu",
"platform": "ubuntu",
"type": "linux",
"version": "20.04.5 LTS (Focal Fossa)"
}
},
"input": {
"type": "log"
},
"log": {
"file": {
"path": "/tmp/service_logs/access.log"
},
"offset": 0
},
"tags": [
"nginx-access"
]
}

0 comments on commit 4d92587

Please sign in to comment.