Loki
We offer access to a Loki endpoint under https://<tenant>-api.codebgp.com/logs
. To access, you first need to get the corresponding credentials from Code BGP. For a full documentation of the Loki API please check this page.
If you need to simply get all the logs (BGP updates) that were collected between t1 and t2 use the following command:
curl -X GET 'https://<tenant>-api.codebgp.com/logs/loki/api/v1/query?query=\{job="kafka"\}&from=t1&to=t2' -H 'Content-Type: application/json' -u 'username:password'
You can also filter the result, in the query, similar to the way we achieve this in grafana.
The following labels are available for filtering BGP updates in log stream selector or label filter expression:
action
(add
for announcement,del
for withdrawal)data_service
(RIS_LIVE
,CODEBGP_MONITOR
,BGP_ROUTER
)ip_version
(4, 6)
The following labels are available for filtering BGP updates in label filter expression or line filter expression:
as_path_str
(in format "1 2 ...")prefix
(without the mask suffix e.g.,10.0.0.0
)mask_length
peer_asn
(for monitor peer interfaces)peer_ip
(for monitor peer interfaces)host
(rrcX
ifRIPE_RIS
data service)