Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promtail: Simple way to construct json from simple log line #12408

Open
KVInventoR opened this issue Mar 30, 2024 · 1 comment
Open

Promtail: Simple way to construct json from simple log line #12408

KVInventoR opened this issue Mar 30, 2024 · 1 comment

Comments

@KVInventoR
Copy link

Hi all,

Is there any simple way to construct and send json which can be created from regexp without using templates?

I tried to use this example, but no luck

- regex:
    expression: '^(?P<timestamp>\w+ \d+ \d+:\d+:\d+) (?P<loglevel>\w+) (?P<message>.*)'
- json:
    expressions:
      timestamp: timestamp
      loglevel: loglevel
      message: message
- labels:
    loglevel: ""

I would like to have log as json object in loki with some labels

@JStickler
Copy link
Contributor

Questions have a better chance of being answered if you ask them on the community forums.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants