Proper use of reduce transform to target go panics #22740
Replies: 4 comments 4 replies
-
Hi @davidcpell, this is correct.
Looking at your |
Beta Was this translation helpful? Give feedback.
-
I went back to do an experiment. Input File
Vector Configdata_dir: path/data/data_dir_0
sources:
source_0:
type: file
include:
- path/data/panics.txt
read_from: "beginning"
transforms:
t0:
type: remap
inputs:
- source_0
source: |
.file = "a"
combine_go_panics:
type: reduce
inputs:
- t0
starts_when:
type: vrl
source: |
starts_with(string!(.message), "panic:")
group_by: ["file"]
merge_strategies:
message: concat_newline
expire_after_ms: 1000
max_events: 1000
sinks:
sink_0:
type: console
inputs:
- combine_go_panics
encoding:
codec: json
json:
pretty: true
Vector Output
|
Beta Was this translation helpful? Give feedback.
-
Thanks @pront.
This is where I still have a gap in my understanding. I don't want to reduce any events aside from the panics. I used your example and added a second file with normal lines: info.txt
When I ran Vector, I saw:
Because of EDIT I went back and re-read the reduce doc, and it seems like I just misread what
So for log files that never have a panic, literally every log will be reduced until the timer runs out. Does what I'm trying to do make sense to you, though? Is there some better way? With |
Beta Was this translation helpful? Give feedback.
-
This seems like it would solve our problem fwiw, since we are using |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use
reduce
to combine go panics into a single log line with newline delimiters. In my testing, this results in a large drop in events received by the sink:A cleaned up version my config looks like this:
I was under the impression
starts_with
would mean an aggregation begins whenpanic: runtime error
is seen and that for any other log a reduce would not begin and it would flow through to the next component as normal. Is that accurate? Any idea on what might be causing what I'm seeing with components received dropping so low on the sink?Beta Was this translation helpful? Give feedback.
All reactions