-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolve an issue where cmd/stanza package tests are pointing to an in…
…valid examples directory (#538)
- Loading branch information
Joseph Sirianni
authored
Feb 4, 2022
1 parent
7065476
commit 1e0fa78
Showing
6 changed files
with
125 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This example configuration uses two plugins that are defined | ||
# in the ./plugins directory. See those files for details | ||
pipeline: | ||
# repeater is a plugin defined by ./plugins/repeater.yaml | ||
- type: repeater | ||
|
||
# decorator is a plugin defined by ./plugins/decorator.yaml | ||
# It adds the label "decorated" to each entry that passes through | ||
# it with the value specified here | ||
- type: decorator | ||
value: my_decorated_value | ||
|
||
- type: stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: 0.0.0 | ||
title: Decorator | ||
description: A decorator plugin | ||
parameters: | ||
- name: value | ||
label: Value | ||
description: A value to decorate the entries | ||
type: string | ||
required: true | ||
|
||
# This plugin is registered as the type 'decorator'. | ||
# The type comes from the filename. | ||
# It take any entries sent to it, and add the label | ||
# 'decorated' to those entries with a value specified | ||
# by the argument 'value' in the top-level pipeline | ||
pipeline: | ||
# The input parameter is replaced with the ID of the | ||
# operator in the top-level config so that the plugin | ||
# graph can be connected properly. | ||
- id: {{ .input }} | ||
type: metadata | ||
labels: | ||
# The value parameter comes from the configuration | ||
# of the plugin in the top-level config | ||
decorated: {{ .value }} | ||
# The output is parameterized with go templates | ||
# so that it can use the output that is configured for the | ||
# plugin in the top-level pipeline | ||
output: {{ .output }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This plugin is registered as the type 'repeater'. | ||
# The type comes from the filename. | ||
# It will generate exactly 5 entries with the same | ||
# timestamp and the content "test record" | ||
pipeline: | ||
- type: generate_input | ||
static: true | ||
entry: | ||
timestamp: "2006-01-02T15:04:05Z" | ||
record: "test record" | ||
count: 5 | ||
# The output is parameterized with go templates | ||
# so that it can use the output that is configured for the | ||
# plugin in the top-level pipeline | ||
output: {{ .output }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
10.66.2.46 - - [13/Mar/2019:10:43:00 -0400] "GET / HTTP/1.1" 404 - | ||
10.66.2.46 - - [13/Mar/2019:10:43:01 -0400] "GET /favicon.ico HTTP/1.1" 404 - | ||
10.66.2.46 - - [13/Mar/2019:10:43:08 -0400] "GET /manager HTTP/1.1" 302 - | ||
10.66.2.46 - - [13/Mar/2019:10:43:08 -0400] "GET /manager/ HTTP/1.1" 403 3420 | ||
10.66.2.46 - - [13/Mar/2019:11:00:26 -0400] "GET /manager/html HTTP/1.1" 401 2473 | ||
10.66.2.46 - tomcat [13/Mar/2019:11:00:53 -0400] "GET /manager/html HTTP/1.1" 200 11936 | ||
10.66.2.46 - - [13/Mar/2019:11:00:53 -0400] "GET /manager/images/asf-logo.svg HTTP/1.1" 200 19698 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
pipeline: | ||
|
||
# Read lines from Apache Tomcat access logs | ||
# Example input line: | ||
# 10.66.2.46 - - [13/Mar/2019:10:43:00 -0400] "GET / HTTP/1.1" 404 - | ||
- type: file_input | ||
start_at: beginning | ||
include: | ||
- ./access.log | ||
labels: | ||
log_type: tomcat | ||
|
||
# Parse the logs into labeled fields | ||
# Example input: | ||
# { | ||
# "timestamp": "2020-06-13T11:00:53-04:00", | ||
# "record": "10.66.2.46 - - [13/Mar/2019:10:43:00 -0400] "GET / HTTP/1.1" 404 -" | ||
# } | ||
- type: regex_parser | ||
regex: >- | ||
(?P<remote_host>[^\s]+) | ||
- | ||
(?P<remote_user>[^\s]+) | ||
\[(?P<timestamp>[^\]]+)\] | ||
"(?P<http_method>[A-Z]+) | ||
(?P<url_path>[^\s]+)[^"]*" | ||
(?P<http_status>\d+) | ||
(?P<bytes_sent>[\d-]+) | ||
timestamp: | ||
parse_from: timestamp | ||
layout: '%d/%b/%Y:%H:%M:%S %z' | ||
severity: | ||
parse_from: http_status | ||
preserve_to: http_status | ||
mapping: | ||
error: "4xx" | ||
info: | ||
- min: 300 | ||
max: 399 | ||
debug: 200 | ||
|
||
# Write the log to stdout | ||
# Example input: | ||
# { | ||
# "timestamp": "2019-03-13T11:00:53-04:00", | ||
# "severity": 60, | ||
# "record": { | ||
# "bytes_sent": "19698", | ||
# "http_method": "GET", | ||
# "http_status": "200", | ||
# "remote_host": "10.66.2.46", | ||
# "remote_user": "-", | ||
# "url_path": "/manager/images/asf-logo.svg" | ||
# } | ||
# } | ||
- type: stdout |