You can find the latest API docs at https://docs.logz.io/api.
logzio / public-api Goto Github PK
View Code? Open in Web Editor NEWLogz.io Public API Documentation
Logz.io Public API Documentation
You can find the latest API docs at https://docs.logz.io/api.
The alert api doesn't seem to work on my account. It doesn't mention in the readme that i need a special licence.
I've tried the following uris, they all return 404
https://app-eu.logz.io/v1/alerts
https://app-eu.logz.io/alerts <- path from swagger file
Interestingly /triggers/alerts
works but the data structure is not the same as the swagger file
[
{
"id": 123,
"name": "Test errors",
"description": "",
"enabled": true,
"search": {
"queryString": "(level:\"ERROR\" OR level:\"FATAL\") AND environment:test",
"filter": "{\"bool\":{\"must\":[],\"must_not\":[]}}",
"groupBy": [],
"periodInMinutes": 5,
"source": {
"allTimelessIndices": false,
"timelessIndices": [],
"allSubAccounts": true,
"subAccountsIds": []
},
"metricsAggregations": []
},
"triggerOn": {
"type": "CONDITION",
"aggregation": {
"aggregationType": "NONE",
"fieldToAggregateOn": null
},
"comparisonOperator": "GREATER_THAN",
"threshold": 0,
"severities": [
{
"severity": "MEDIUM",
"threshold": 0
}
]
},
"output": {
"format": {
"type": "TABLE",
"sortBy": null,
"sortOrder": "DESC",
"fieldsConfig": "[{\"name\":\"stack\",\"data\":\"\"},{\"name\":\"level\",\"data\":\"\"},{\"name\":\"service_name\",\"data\":\"\"},{\"name\":\"message\",\"data\":\"\"}]"
},
"target": {
"severity": "MEDIUM",
"emailNotifications": "{\"notifications\":[]}",
"notificationEndpoints": [
{
"id": 123,
"accountId": xx,
"type": "HTTP",
"templateName": "Slack",
"description": null,
"title": "Test errors",
"createdDate": 1500299065000,
"modifiedDate": 1516189356000,
"params": {
"url": "https://hooks.slack.com/services/xxx",
"method": "POST",
"headers": null,
"bodyTemplate": {
"icon_url": "https://s3.amazonaws.com/logzio-static-content-cdn/logzio-logo.png",
"username": "Logz.io Alerts",
"attachments": [
{
"author_name": "{{&alert_severity}} severity",
"author_icon": "https://s3.amazonaws.com/logzio-static-content-cdn/slack/{{&alert_severity_img}}.png",
"fallback": "{{&alert_severity}}: {{&alert_title}}",
"title": "{{&alert_title}}",
"title_link": "{{&alert_app_url}}#/dashboard/alerts/definitions?switchToAccountId={{&account_id}}",
"pretext": "An alert has been triggered due to an event in your {{&account_name}} account.",
"text": "{{&alert_description}}",
"footer": "{{&alert_timeframe_start}} to {{&alert_timeframe_end}} (UTC)",
"color": "#008ab1"
},
{
"color": "#008ab1",
"fields": [
{
"title": "{{^alert_event_image}}Alert event samples{{/alert_event_image}}",
"value": "{{^alert_event_image}}{{^alert_event_samples}}No event samples available{{/alert_event_samples}}{{&alert_event_samples}}{{/alert_event_image}}",
"short": false
}
],
"image_url": "{{&alert_event_image}}"
},
{
"fields": [
{
"value": "{{#alert_event_html}}<{{&alert_event_html}}|Open full view>{{/alert_event_html}}",
"short": false
},
{
"value": "<{{&alert_app_url}}#/dashboard/alerts/view-alert-in-kibana?eventTimestamp={{&alert_event_timestamp}}&timeRangeInMinutes={{&alert_time_range_in_millis}}&alertDefinitionId={{&alert_definition_id}}&switchToAccountId={{&account_id}}|View in Kibana>",
"short": false
}
],
"color": "#008ab1"
}
]
}
},
"internal_type": "HTTP"
}
],
"suppressNotificationInMinutes": 60,
"timelessIndex": null
}
},
"lastUpdatedOn": null
},
]
Request header field X-USER-TOKEN is not allowed by Access-Control-Allow-Headers in preflight response.
This happens when interacting with the API using javascript like so
const headers = {
'Content-Type': 'application/json;charset=UTF-8',
'X-USER-TOKEN': USER_TOKEN
};
return fetch(
'https://api.logz.io/v1/search',
'post',
headers,
body
);
It was working about a couple of days ago.
Hi, what does the following mean and how can I resolve it?
Cheers, Christian.
curl -v -X GET -H 'X-API-TOKEN: <my.token>' -H 'Content-Type: application/json' https://api.logz.io/v1/alerts/26179
* Trying 143.204.214.64...
* TCP_NODELAY set
* Connected to api.logz.io (143.204.214.64) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.logz.io
* start date: May 16 00:00:00 2018 GMT
* expire date: Jul 14 23:59:59 2020 GMT
* subjectAltName: host "api.logz.io" matched cert's "*.logz.io"
* issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO RSA Domain Validation Secure Server CA
* SSL certificate verify ok.
> GET /v1/alerts/26179 HTTP/1.1
> Host: api.logz.io
> User-Agent: curl/7.58.0
> Accept: */*
> X-API-TOKEN: <my.token>
> Content-Type: application/json
>
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Content-Length: 72
< Connection: keep-alive
< Date: Wed, 15 Aug 2018 15:09:33 GMT
< x-amzn-RequestId: 37599f14-a09d-11e8-9d13-218aed5203ba
< x-amz-apigw-id: Lq9HFEasoAMFl5Q=
< X-Amzn-Trace-Id: Root=1-5b74422d-81861b3ce67c2288efbb9d54
< X-Cache: Error from cloudfront
< Via: 1.1 1f5757b46371746e677236d4fc67d364.cloudfront.net (CloudFront)
< X-Amz-Cf-Id: n5S90MxhsU4johMmBsp0cku6JQ2abe-xX2vLS53SCRwx0Lq_931pXQ==
<
* Connection #0 to host api.logz.io left intact
In addition to the current document, swagger/OpenAPI spec will be nice - it makes the integration a lot simpler. For example - client code generation.
Create alert Swagger doc says:
However the actual service says:
"Failed to create alert"
(in plaintext, not json, response should be in JSON)My request (failing)
{
"alertNotificationEndpoints": [],
"description": "",
"groupByAggregationFields": null,
"isEnabled": true,
"notificationEmails": [
"[email protected]"
],
"query_string": "loglevel:ERROR",
"searchTimeFrameMinutes": 5,
"severityThresholdTiers": [],
"suppressNotificationMinutes": 5,
"title": "hello",
"valueAggregationField": null,
"valueAggregationType": "NONE"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.