Repository navigation
|
OS: Rocky Linux 9.6 Let's imagine we have a Bareos log file located at /var/log/bareos/bareos.log with 2 lines like this: In vector.yaml we add a source section with this file: After that we'd like to extract multiple fields in order to filter logs in VictoriaLogs. We do it using transform section, remap function and regex: Finally, we sink the result into Vlogs using HTTP: In result, Vector seems to sink only the message field from the input file and do not actually get required fileds using the parser: I believe I've failed to correctly set up a parser and I require some help. Thanks in advance! |
Replies: 3 comments 4 replies
|
Hi @Rawoosa, I recommend attaching a console:
type: console
inputs: [ "parser-bareos" ]
encoding:
codec: json
json:
pretty: trueAlso, vector tap is another helpful debugging tool to inspect what comes out of the |
|
This parses all 17 sample lines. The year and timezone are explicit because the log does not contain them; Try the complete program in the VRL playground. Please don't hesitate to followup in this thread if you have further questions. |
|
You're an absolute legend. Not only I forgot I even started this thread, I left the workplace where I was messing around with Vector almost a year ago. |


parse_regexis the right function for one log line. The failure in the original program isparse_timestamp:%d-%b %H:%Mdoes not supply a year. With the defaultdrop_on_error: false, the failed remap forwards the original event, which explains the missing parsed fields.This parses all 17 sample lines. The year and timezone are explicit because the log does not contain them;
2025andUTCare example values to replace with the correct values for your logs.