Skip to content

Commit 7b5498a

Browse files
authored
Initial commit of stanza codebase (#3)
* Initial commit of stanza codebase
1 parent f07b777 commit 7b5498a

File tree

353 files changed

+45539
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

353 files changed

+45539
-0
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
artifacts/stanza_darwin_amd64
2+
artifacts/stanza_windows_amd64
3+
.git/
4+
dev/

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dev/*
2+
.DS_Store
3+
tmp/*
4+
local/*
5+
**/coverage.txt
6+
**/coverage.html
7+
artifacts/*
8+
.vscode/*
9+
gen/

.golangci.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
linters:
3+
enable:
4+
- bodyclose
5+
- goconst
6+
- gocritic
7+
- goimports
8+
- maligned
9+
- misspell
10+
- nakedret
11+
- prealloc
12+
- unconvert
13+
- unparam
14+
- whitespace
15+
- ineffassign

CHANGELOG.md

+239
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [0.13.12] - 2020-01-26
8+
9+
### Changed
10+
- Allow plugin parameters to have a default value even if they are required
11+
12+
## [0.13.11] - 2020-01-15
13+
14+
### Changed
15+
- Updated version of stanza used in several isolated modules
16+
17+
## [0.13.10] - 2020-01-15
18+
19+
### Added
20+
- `timestamp` parser now supports a `location` parameter
21+
22+
## [0.13.9] - 2020-01-04
23+
24+
### Fixed
25+
- `k8s_metadata_decorator` using a proxy causes internal API timeout
26+
27+
## [0.13.8] - 2020-12-30
28+
### Fixed
29+
- `file_input` exclude processing could result in extra exclusions
30+
31+
## [0.13.7] - 2020-12-23
32+
### Added
33+
- Ability to customize `file_input`'s `fingerprint_size`
34+
## [0.13.6] - 2020-12-18
35+
### Fixed
36+
- Issue where timestamps ending 'Z' were not treated as UTC
37+
- Issue where recognized timezones may not properly calculate offsets
38+
- Issue where `file_output` would escape html special characters
39+
40+
## [0.13.5] - 2020-12-09
41+
### Fixed
42+
- Issue where flushers would retry indefinitely
43+
- Issue where flushers would improperly reuse the same http request multiple times
44+
45+
## [0.13.4] - 2020-12-07
46+
### Added
47+
- Recombine operator to combine multiline logs after ingestion and parsing
48+
49+
### Fixed
50+
- Issue where entries skipped by `if` would be output twice
51+
52+
## [0.13.3] - 2020-12-01
53+
### Added
54+
- New operators `forward_output` and `forward_input` to easily send log entries between stanza instances.
55+
- Override default timestamp with `STANZA_DEFAULT_TIMESTAMP` for integration testing
56+
- Add new `bytesize` type for easier configuration of byte sizes
57+
- Automatic severity promotion in the syslog parser
58+
### Fixed
59+
- Open files in chunks so that we don't hit open file limit and cause performance issues
60+
61+
## [0.13.2] - 2020-11-17
62+
### Added
63+
- New parameter `if` to parser plugins to allow for easy conditional parsing without routers
64+
- New `default` parameter to the router to explicitly send unmatched entries to a specific operator(s)
65+
66+
## [0.13.1] - 2020-11-11
67+
### Fixed
68+
- Missing default configuration of `elastic_output` flusher
69+
### Changed
70+
- A plugin that fails to parse will now log an error, but will not cause stanza to fail to start
71+
### Added
72+
- New `stdin` operator
73+
74+
## [0.13.0] - 2020-11-09
75+
### Added
76+
- OTLP severity level recognition
77+
- Severity Text field on Entry
78+
### Changed
79+
- Removed `preserve` in favor of `preserve_to` to make it more clear that it may overwrite parsed fields
80+
- Updated our internal log sampling numbers to more aggressively sample repeated logs
81+
### Added
82+
- Log message whenever a new file is detected
83+
84+
## [0.12.5] - 2020-10-07
85+
### Added
86+
- `windows_eventlog_input` can now parse messages from the Security channel.
87+
88+
## [0.12.4] - 2020-10-07
89+
### Fixed
90+
- Router outputs were not namespaced correctly
91+
92+
## [0.12.3] - 2020-10-07
93+
### Fixed
94+
- (De)serialization of JSON for plugin config structs
95+
96+
## [0.12.2] - 2020-10-06
97+
### Added
98+
- New Relic Logs output operator
99+
- Additional resource values with parent object names (service name, replica set name, etc.) in the k8s metadata operator
100+
- Publicly available `version.GetVersion()` for consumers of the `stanza` module
101+
102+
## [0.12.0] - 2020-09-21
103+
### Changed
104+
- Most operators are no longer part of dedicated modules
105+
106+
## [0.11.0] - 2020-09-15
107+
### Changed
108+
- File input improvements and rotation tests
109+
110+
## [0.10.0] - 2020-09-11
111+
### Added
112+
- Disk buffer for output operators ([PR109](https://github.com/observIQ/stanza/pull/109))
113+
### Changed
114+
- Split buffers into buffers and flushers for better modularity ([PR109](https://github.com/observIQ/stanza/pull/109))
115+
- New memory buffer design for a uniform interface between disk and memory buffers ([PR109](https://github.com/observIQ/stanza/pull/109))
116+
- Most operators are now dedicated modules, so that they may be imported individually ([PR108](https://github.com/observIQ/stanza/pull/108))
117+
118+
## [0.9.14] - 2020-08-31
119+
### Fixed
120+
- Rendering issue with the `kubernetes_events` plugin
121+
122+
## [0.9.13] - 2020-08-31
123+
### Added
124+
- Support for accessing the resource with fields ([PR105](https://github.com/observIQ/stanza/pull/105))
125+
- Support for using fields to select keys that contain dots like `$record['field.with.dots']` ([PR105](https://github.com/observIQ/stanza/pull/105))
126+
- `google_cloud_output` will use resource create a monitored resource for supported resource types (currently only k8s resources) ([PR105](https://github.com/observIQ/stanza/pull/105))
127+
### Changed
128+
- The operators `host_metadata`, `k8s_event_input`, and `k8s_metadata_decorator` will now use the top-level resource field ([PR105](https://github.com/observIQ/stanza/pull/105))
129+
- `k8s_metadata_decorator` now generates pod labels that match those generated by GKE ([PR105](https://github.com/observIQ/stanza/pull/105))
130+
### Fixed
131+
- Issue with `k8s_event_input` generating entries with zero-valued time ([PR105](https://github.com/observIQ/stanza/pull/105))
132+
- Plugin ID in templates will now correctly default to the plugin type if unset ([PR105](https://github.com/observIQ/stanza/pull/105))
133+
134+
135+
## [0.9.12] - 2020-08-25
136+
### Changed
137+
- Agent is now embeddable with a default output
138+
139+
## [0.9.11] - 2020-08-24
140+
### Added
141+
- The 'filter' operator
142+
143+
### Changed
144+
- Renamed project to `stanza`
145+
- Move `testutil` package out of `internal`
146+
147+
## [0.9.10] - 2020-08-20
148+
### Added
149+
- The `Resource` field was added to Entry ([PR95](https://github.com/observIQ/stanza/pull/95))
150+
- The `Identifier` helper was created to assist with writing to `Resource` ([PR95](https://github.com/observIQ/stanza/pull/95))
151+
152+
### Removed
153+
- The `Tags` field was removed from Entry ([PR95](https://github.com/observIQ/stanza/pull/95))
154+
155+
### Changed
156+
- The `host_metadata` operator now writes to an entry's `Resource` field, instead of Labels
157+
- The `host_labeler` helper has been renamed `host_identifier`
158+
- The `metadata` operator embeds the `Identifier` helper and supports writing to `Resource`
159+
- Input operators embed the `Identifier` helper and support writing to `Resource`
160+
- The `k8s_event` operator now supports the `write_to`, `labels`, and `resource` configuration options
161+
- Multiline for `file_input` now supports matching on new lines characters ([PR96](https://github.com/observIQ/stanza/pull/96))
162+
163+
## [0.9.9] - 2020-08-14
164+
### Added
165+
- Kubernetes events input operator ([PR88](https://github.com/observIQ/stanza/pull/88))
166+
### Fixed
167+
- Small improvements to test stability
168+
- Fallback to reflection to convert entries to Google Cloud log entries ([PR93](https://github.com/observIQ/stanza/pull/93))
169+
170+
## [0.9.8] - 2020-08-12
171+
### Fixed
172+
- Google Cloud Output failure when sent a field of type uint16 ([PR82](https://github.com/observIQ/stanza/pull/82))
173+
### Added
174+
- Added a default function to plugin templates ([PR84](https://github.com/observIQ/stanza/pull/84))
175+
- Add a host metadata operator that adds hostname and IP to entries ([PR85](https://github.com/observIQ/stanza/pull/85))
176+
- Google Cloud Output option to enable gzip compression ([PR86](https://github.com/observIQ/stanza/pull/86))
177+
178+
## [0.9.7] - 2020-08-05
179+
### Changed
180+
- In the file input operator, file name and path fields are now added with `include_file_name` (default `true`) and `include_file_path` (default `false`)
181+
- Input and router operators can define labels on entries using the `labels` field
182+
- Add Event ID to windows event log entries
183+
- Use the `go-syslog` fork directly rather than relying on a `replace` directive so that the agent can be used as a library successfully
184+
185+
## [0.9.6] - 2020-08-04
186+
### Changed
187+
- Fork go-syslog to support long sdnames that are not rfc5424-compliant
188+
- Reduce noise in debug messages for TCP and UDP inputs
189+
### Added
190+
- `log_type` label added by default to input operators
191+
### Fixed
192+
- Trim carriage returns from TCP input
193+
194+
## [0.9.5] - 2020-07-28
195+
### Added
196+
- Configurable `timeout` parameter for the `k8s_metadata_decorator` ([PR54](https://github.com/observIQ/stanza/pull/54))
197+
- Journald operator now supports `start_at` parameter ([PR55](https://github.com/observIQ/stanza/pull/55))
198+
199+
### Changed
200+
- Enhanced plugin parameter metadata structure, to support required/optional and default values ([PR59](https://github.com/observIQ/stanza/pull/59))
201+
202+
### Fixed
203+
- Issue where multiple instances of `syslog_parser` would cause parsing errors ([PR61](https://github.com/observIQ/stanza/pull/61))
204+
- `short destination buffer` error now is handled by increasing encoding buffer size ([PR58](https://github.com/observIQ/stanza/pull/58))
205+
- Issue where omitting the output field in a plugin could result in errors ([PR56](https://github.com/observIQ/stanza/pull/56))
206+
207+
## [0.9.4] - 2020-07-21
208+
- Allow omitting `id`, defaulting to plugin type if unique within namespace
209+
- Allow omitting `output`, defaulting to the next operator in the pipeline if valid
210+
211+
## [0.9.3] - 2020-07-20
212+
### Added
213+
- Support for multiple encodings in the file input plugin ([PR39](https://github.com/observIQ/stanza/pull/39))
214+
- Install scripts and docker image now include plugins from `stanza-plugins` repository ([PR45](https://github.com/observIQ/stanza/pull/45))
215+
- Publish image to dockerhub ([PR42](https://github.com/observIQ/stanza/pull/42))
216+
- Improved default configuration ([PR41](https://github.com/observIQ/stanza/pull/41))
217+
- Basic developer documentation ([PR43](https://github.com/observIQ/stanza/pull/43))
218+
### Fixed
219+
- JournalD emits `map[string]interface{}` ([PR38](https://github.com/observIQ/stanza/pull/38))
220+
221+
## [0.9.2] - 2020-07-13
222+
### Added
223+
- Link `stanza` into `/usr/local/bin` so it's available on most users' `PATH` ([PR28](https://github.com/observIQ/stanza/pull/28))
224+
- New parameter `file_name_path` to the file input plugin for cases when just the file name is needed
225+
### Changed
226+
- Renamed `path_field` to `file_path_field` in the file input plugin
227+
### Fixed
228+
- Failure in Google Cloud Output to convert some data types to protocol buffers
229+
230+
## [0.9.1] - 2020-07-13
231+
### Added
232+
- More specific warning and error messages for common configuration issues ([PR12](https://github.com/observIQ/stanza/pull/12),[PR13](https://github.com/observIQ/stanza/pull/13),[PR14](https://github.com/observIQ/stanza/pull/14))
233+
### Fixed
234+
- Writing from files being actively written to will sometimes read partial entries ([PR21](https://github.com/observIQ/stanza/pull/21))
235+
- Minor documentation omissions
236+
237+
## [0.9.0] - 2020-07-07
238+
### Added
239+
- Initial open source release. See documentation for full list of supported features in this version.

Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM ubuntu:bionic
2+
3+
RUN mkdir -p /stanza_home
4+
ENV STANZA_HOME=/stanza_home
5+
RUN echo "pipeline:\n" >> /stanza_home/config.yaml
6+
RUN apt-get update && apt-get install -y systemd ca-certificates
7+
8+
COPY ./artifacts/stanza_linux_amd64 /stanza_home/stanza
9+
COPY ./artifacts/stanza-plugins.tar.gz /tmp/stanza-plugins.tar.gz
10+
RUN tar -zxvf /tmp/stanza-plugins.tar.gz -C /stanza_home/
11+
ENTRYPOINT /stanza_home/stanza \
12+
--config /stanza_home/config.yaml \
13+
--database /stanza_home/stanza.db \
14+
--plugin_dir /stanza_home/plugins

0 commit comments

Comments
 (0)