sipcapture / homer

HOMER - 100% Open-Source SIP, VoIP, RTC Packet Capture & Monitoring
https://sipcapture.org
GNU Affero General Public License v3.0
1.58k stars 239 forks source link

Template for loki #602

Closed iamhalje closed 1 year ago

iamhalje commented 1 year ago

Please help me with my questions in this situation:

1) if loki does not use authorization, is it correct to keep the pass and user settings in the config (example from webapp_config.json)

"loki_config": { "api": "loki/api/v1", "enable": true, "help": "Settings for LOKI Database (optional)", "host": "http://localhost:3100", "param_query": "query_range", "user": "admin", "pass": "admin"

2) after viewing the damp to automatically view the log without touching anything manual, how to replace the standard job and parse in logql? (configure logql automatic query for yourself)

loki

3) from which version of the homer can you send requests to loki? (that is, when he was release version)

Thank you all in advance!

github-actions[bot] commented 1 year ago

Please star this repository to motivate the developers and to get higher priority! :star:

iamhalje commented 1 year ago

the main question of course is number 2, is there a variable to replace job heplify-server?

iamhalje commented 1 year ago

this will be enough if you answer question number 2, accidentally closed the ticket*

lmangani commented 1 year ago

after viewing the damp to automatically view the log without touching anything manual, how to replace the standard job and parse in logql? (configure logql automatic query for yourself)

Not sure I understand. You will have to push the log search button at least once for the query to start, making this automatic would cause lots of unecessary connections for an on-demand action. You can customize the logql query selector pattern.

@AlexeyOplachko will provide the configuration options for the logql query template.

iamhalje commented 1 year ago

yes, need to configure the template, for a start, at least change the standard job heplify-server, then I'm waiting for a template with parameters for logql

for example on {service=~"opensips|rtpengine"} and callid like now

AlexeyOplachko commented 1 year ago

We've addressed this in latest PR, new version should be released pretty soon. To add template you want to add property template in loki_config part of homer config. I.e.

"loki_config": {
        "help": "Settings for LOKI Database (optional)",
        "user": "admin",
        "password": "admin",
        "param_query": "query_range",
        "regexp": false,
        "host": "http://127.0.0.1:3100",
        "template": "{job=\"heplify-server\"}",
        "external_url": "",
        "api": "loki/api/v1",
        "enable": true
    },

Edit: We with the team thought up of an upgrade for this, will implement later today

iamhalje commented 1 year ago

okay, looking forward to, thanks

AlexeyOplachko commented 1 year ago

Update: You now are able to provide full template. I.e. if you change config to "{job=\"test-server\" |~ \"%callid%\"}" it'll replace %callid% with callids from the correlated call

iamhalje commented 1 year ago

thanks for adding this feature.