Unable to scrape dockerized python apps: multiline logs #4001
gh-arashok
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team, has anyone here had experience with multiline python logging my tail plugin is not working as expected. I would like some feedback. Each line in the output is coming as a new line ideally multiline support should be enabled. What am i missing in my config. Something tells me the multiline parser rules are incorrect. Would love some feedback.
sample log file
Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/flask/app.py", line 2548, in __call__ return self.wsgi_app(environ, start_response) File "/usr/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app response = self.handle_exception(e) File "/usr/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3.10/site-packages/flask/app.py", line 1822, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/python-test-app/main.py", line 33, in crash raise ValueError(textwrap.fill(textwrap.dedent(""" ValueError: This is a test exception generated, everyline is a multiline This is the last line
`
inputs: |
[INPUT]
Name tail
Path /var/log/containers/helloworld-*.log
Tag kube.<namespace_name>.<pod_name>.<container_name>
multiline.parser docker
[OUTPUT]
Name stdout
Match *
[MULTILINE_PARSER]
name multiline-regex-test
type regex
flush_timeout 1000
#
# Regex rules for multiline parsing
# ---------------------------------
#
# configuration hints:
#
# - first state always has the name: start_state
# - every field in the rule must be inside double quotes
#
# rules | state name | regex pattern | next state
# ------|---------------|--------------------------------------------
rule "start_state" "/^Traceback/" "cont"
rule "cont" "/^Traceback/" "cont"
`
Beta Was this translation helpful? Give feedback.
All reactions