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

openobserve config is incorrect #4912

Open
dch opened this issue Apr 19, 2024 · 2 comments
Open

openobserve config is incorrect #4912

dch opened this issue Apr 19, 2024 · 2 comments
Labels

Comments

@dch
Copy link

dch commented Apr 19, 2024

syslog-ng

Version of syslog-ng

4.6.0

Platform

FreeBSD 15.0-CURRENT amd64

Issue

syslog-ng is unable to send entries to openobserve because SCL creates invalid URL.

Failure

## syslog-ng -dFe
... happy startup
[2024-04-19T13:00:25.873080] syslog-ng starting up; version='4.6.0'
... incoming message from logger
[2024-04-19T13:00:31.830196] Outgoing message; message='Apr 19 13:00:31 akai operator[88707]: sup tank\x0a'
... incorrect url contains unexpected :5080 port
[2024-04-19T13:00:25.916346] curl: error sending HTTP request;
  url='https://api.openobserve.ai:5080/api/default/dave_organization_12345_...../default/_json',
  error='Timeout was reached',
  worker_index='0',
  driver='d_openobserve#0',
  location='/usr/local/share/syslog-ng/include/scl/openobserve/openobserve.conf:46:5'
...

Steps to reproduce

run as above.

NB openobserve supplied url is of form:

https://api.openobserve.ai/api/dave_organization_12345_...//_json

Configuration

log {
    source(src);
    destination(d_openobserve);
};

destination d_openobserve {
    openobserve-log(
        user("dch@...")
        password("...")
        url("https://api.openobserve.ai")
        stream("dave_organization_12345_..")
  );
};

This can be fixed trivially in /usr/local/share/syslog-ng/include/scl/openobserve/openobserve.conf:

...
        url("`url`:/api/`organization`/`stream`/_json")

i.e. omitting port. Ideally, if port(1234) is set in syslog-ng.conf file,
then the configured port would be inserted, but only if set.

@dch dch added the bug label Apr 19, 2024
@bazsi
Copy link
Collaborator

bazsi commented Apr 21, 2024

maybe set port to the default port of the openobserve cloud instance? Unfortantely the block constructs don't support anything but simple string substitution, so if we want to make the port number configurable it needs to be part of the template.

if we set port() to 443 by default that should work on cloud instances, right?

@dch
Copy link
Author

dch commented Apr 22, 2024

I was pretty sure I tried and failed with this in the weekend, but it works fine today :-)

port(443) seems like a good default to use in future, and then this should all work. thanks!!

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

No branches or pull requests

2 participants