Replace an E2M
curl --request PUT \
--url https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2 \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "Service_catalog_latency",
"createTime": "2022-06-30T12:30:00Z'",
"description": "avg and max the latency of catalog service",
"id": "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
"isInternal": true,
"metricFields": [
{
"aggregations": [
{
"enabled": true,
"none": {},
"targetMetricName": "alias_field_name_agg_func"
}
],
"sourceField": "log_obj.numeric_field",
"targetBaseMetricName": "alias_field_name"
}
],
"metricLabels": [
{
"sourceField": "log_obj.string_value",
"targetLabel": "alias_label_name"
}
],
"spansQuery": {
"actionFilters": [
"myAction"
],
"applicationnameFilters": [
"myApp"
],
"lucene": "applicationName:myApp",
"serviceFilters": [
"myService"
],
"subsystemnameFilters": [
"mySubsystem"
]
},
"updateTime": "2022-06-30T12:30:00Z'"
}
EOFimport requests
url = "https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2"
payload = {
"name": "Service_catalog_latency",
"createTime": "2022-06-30T12:30:00Z'",
"description": "avg and max the latency of catalog service",
"id": "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
"isInternal": True,
"metricFields": [
{
"aggregations": [
{
"enabled": True,
"none": {},
"targetMetricName": "alias_field_name_agg_func"
}
],
"sourceField": "log_obj.numeric_field",
"targetBaseMetricName": "alias_field_name"
}
],
"metricLabels": [
{
"sourceField": "log_obj.string_value",
"targetLabel": "alias_label_name"
}
],
"spansQuery": {
"actionFilters": ["myAction"],
"applicationnameFilters": ["myApp"],
"lucene": "applicationName:myApp",
"serviceFilters": ["myService"],
"subsystemnameFilters": ["mySubsystem"]
},
"updateTime": "2022-06-30T12:30:00Z'"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Service_catalog_latency',
createTime: '2022-06-30T12:30:00Z\'',
description: 'avg and max the latency of catalog service',
id: 'd6a3658e-78d2-47d0-9b81-b2c551f01b09',
isInternal: true,
metricFields: [
{
aggregations: [{enabled: true, none: {}, targetMetricName: 'alias_field_name_agg_func'}],
sourceField: 'log_obj.numeric_field',
targetBaseMetricName: 'alias_field_name'
}
],
metricLabels: [{sourceField: 'log_obj.string_value', targetLabel: 'alias_label_name'}],
spansQuery: {
actionFilters: ['myAction'],
applicationnameFilters: ['myApp'],
lucene: 'applicationName:myApp',
serviceFilters: ['myService'],
subsystemnameFilters: ['mySubsystem']
},
updateTime: '2022-06-30T12:30:00Z\''
})
};
fetch('https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Service_catalog_latency',
'createTime' => '2022-06-30T12:30:00Z\'',
'description' => 'avg and max the latency of catalog service',
'id' => 'd6a3658e-78d2-47d0-9b81-b2c551f01b09',
'isInternal' => true,
'metricFields' => [
[
'aggregations' => [
[
'enabled' => true,
'none' => [
],
'targetMetricName' => 'alias_field_name_agg_func'
]
],
'sourceField' => 'log_obj.numeric_field',
'targetBaseMetricName' => 'alias_field_name'
]
],
'metricLabels' => [
[
'sourceField' => 'log_obj.string_value',
'targetLabel' => 'alias_label_name'
]
],
'spansQuery' => [
'actionFilters' => [
'myAction'
],
'applicationnameFilters' => [
'myApp'
],
'lucene' => 'applicationName:myApp',
'serviceFilters' => [
'myService'
],
'subsystemnameFilters' => [
'mySubsystem'
]
],
'updateTime' => '2022-06-30T12:30:00Z\''
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2"
payload := strings.NewReader("{\n \"name\": \"Service_catalog_latency\",\n \"createTime\": \"2022-06-30T12:30:00Z'\",\n \"description\": \"avg and max the latency of catalog service\",\n \"id\": \"d6a3658e-78d2-47d0-9b81-b2c551f01b09\",\n \"isInternal\": true,\n \"metricFields\": [\n {\n \"aggregations\": [\n {\n \"enabled\": true,\n \"none\": {},\n \"targetMetricName\": \"alias_field_name_agg_func\"\n }\n ],\n \"sourceField\": \"log_obj.numeric_field\",\n \"targetBaseMetricName\": \"alias_field_name\"\n }\n ],\n \"metricLabels\": [\n {\n \"sourceField\": \"log_obj.string_value\",\n \"targetLabel\": \"alias_label_name\"\n }\n ],\n \"spansQuery\": {\n \"actionFilters\": [\n \"myAction\"\n ],\n \"applicationnameFilters\": [\n \"myApp\"\n ],\n \"lucene\": \"applicationName:myApp\",\n \"serviceFilters\": [\n \"myService\"\n ],\n \"subsystemnameFilters\": [\n \"mySubsystem\"\n ]\n },\n \"updateTime\": \"2022-06-30T12:30:00Z'\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Service_catalog_latency\",\n \"createTime\": \"2022-06-30T12:30:00Z'\",\n \"description\": \"avg and max the latency of catalog service\",\n \"id\": \"d6a3658e-78d2-47d0-9b81-b2c551f01b09\",\n \"isInternal\": true,\n \"metricFields\": [\n {\n \"aggregations\": [\n {\n \"enabled\": true,\n \"none\": {},\n \"targetMetricName\": \"alias_field_name_agg_func\"\n }\n ],\n \"sourceField\": \"log_obj.numeric_field\",\n \"targetBaseMetricName\": \"alias_field_name\"\n }\n ],\n \"metricLabels\": [\n {\n \"sourceField\": \"log_obj.string_value\",\n \"targetLabel\": \"alias_label_name\"\n }\n ],\n \"spansQuery\": {\n \"actionFilters\": [\n \"myAction\"\n ],\n \"applicationnameFilters\": [\n \"myApp\"\n ],\n \"lucene\": \"applicationName:myApp\",\n \"serviceFilters\": [\n \"myService\"\n ],\n \"subsystemnameFilters\": [\n \"mySubsystem\"\n ]\n },\n \"updateTime\": \"2022-06-30T12:30:00Z'\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Service_catalog_latency\",\n \"createTime\": \"2022-06-30T12:30:00Z'\",\n \"description\": \"avg and max the latency of catalog service\",\n \"id\": \"d6a3658e-78d2-47d0-9b81-b2c551f01b09\",\n \"isInternal\": true,\n \"metricFields\": [\n {\n \"aggregations\": [\n {\n \"enabled\": true,\n \"none\": {},\n \"targetMetricName\": \"alias_field_name_agg_func\"\n }\n ],\n \"sourceField\": \"log_obj.numeric_field\",\n \"targetBaseMetricName\": \"alias_field_name\"\n }\n ],\n \"metricLabels\": [\n {\n \"sourceField\": \"log_obj.string_value\",\n \"targetLabel\": \"alias_label_name\"\n }\n ],\n \"spansQuery\": {\n \"actionFilters\": [\n \"myAction\"\n ],\n \"applicationnameFilters\": [\n \"myApp\"\n ],\n \"lucene\": \"applicationName:myApp\",\n \"serviceFilters\": [\n \"myService\"\n ],\n \"subsystemnameFilters\": [\n \"mySubsystem\"\n ]\n },\n \"updateTime\": \"2022-06-30T12:30:00Z'\"\n}"
response = http.request(request)
puts response.read_body{
"e2m": {
"name": "Service_catalog_latency",
"createTime": "2022-06-30T12:30:00Z'",
"description": "avg and max the latency of catalog service",
"id": "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
"isInternal": true,
"logsQuery": {
"alias": "new_query",
"applicationnameFilters": [
"app_name"
],
"lucene": "log_obj.numeric_field: [50 TO 100]",
"severityFilters": [],
"subsystemnameFilters": [
"sub_name"
]
},
"metricFields": [
{
"aggregations": [
{
"enabled": true,
"none": {},
"targetMetricName": "alias_field_name_agg_func"
}
],
"sourceField": "log_obj.numeric_field",
"targetBaseMetricName": "alias_field_name"
}
],
"metricLabels": [
{
"sourceField": "log_obj.string_value",
"targetLabel": "alias_label_name"
}
],
"permutations": {
"hasExceededLimit": true,
"limit": 30000
},
"updateTime": "2022-06-30T12:30:00Z'"
}
}Events2Metrics Service
Replace an E2M
No description available
Replace an E2M
curl --request PUT \
--url https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2 \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "Service_catalog_latency",
"createTime": "2022-06-30T12:30:00Z'",
"description": "avg and max the latency of catalog service",
"id": "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
"isInternal": true,
"metricFields": [
{
"aggregations": [
{
"enabled": true,
"none": {},
"targetMetricName": "alias_field_name_agg_func"
}
],
"sourceField": "log_obj.numeric_field",
"targetBaseMetricName": "alias_field_name"
}
],
"metricLabels": [
{
"sourceField": "log_obj.string_value",
"targetLabel": "alias_label_name"
}
],
"spansQuery": {
"actionFilters": [
"myAction"
],
"applicationnameFilters": [
"myApp"
],
"lucene": "applicationName:myApp",
"serviceFilters": [
"myService"
],
"subsystemnameFilters": [
"mySubsystem"
]
},
"updateTime": "2022-06-30T12:30:00Z'"
}
EOFimport requests
url = "https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2"
payload = {
"name": "Service_catalog_latency",
"createTime": "2022-06-30T12:30:00Z'",
"description": "avg and max the latency of catalog service",
"id": "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
"isInternal": True,
"metricFields": [
{
"aggregations": [
{
"enabled": True,
"none": {},
"targetMetricName": "alias_field_name_agg_func"
}
],
"sourceField": "log_obj.numeric_field",
"targetBaseMetricName": "alias_field_name"
}
],
"metricLabels": [
{
"sourceField": "log_obj.string_value",
"targetLabel": "alias_label_name"
}
],
"spansQuery": {
"actionFilters": ["myAction"],
"applicationnameFilters": ["myApp"],
"lucene": "applicationName:myApp",
"serviceFilters": ["myService"],
"subsystemnameFilters": ["mySubsystem"]
},
"updateTime": "2022-06-30T12:30:00Z'"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Service_catalog_latency',
createTime: '2022-06-30T12:30:00Z\'',
description: 'avg and max the latency of catalog service',
id: 'd6a3658e-78d2-47d0-9b81-b2c551f01b09',
isInternal: true,
metricFields: [
{
aggregations: [{enabled: true, none: {}, targetMetricName: 'alias_field_name_agg_func'}],
sourceField: 'log_obj.numeric_field',
targetBaseMetricName: 'alias_field_name'
}
],
metricLabels: [{sourceField: 'log_obj.string_value', targetLabel: 'alias_label_name'}],
spansQuery: {
actionFilters: ['myAction'],
applicationnameFilters: ['myApp'],
lucene: 'applicationName:myApp',
serviceFilters: ['myService'],
subsystemnameFilters: ['mySubsystem']
},
updateTime: '2022-06-30T12:30:00Z\''
})
};
fetch('https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Service_catalog_latency',
'createTime' => '2022-06-30T12:30:00Z\'',
'description' => 'avg and max the latency of catalog service',
'id' => 'd6a3658e-78d2-47d0-9b81-b2c551f01b09',
'isInternal' => true,
'metricFields' => [
[
'aggregations' => [
[
'enabled' => true,
'none' => [
],
'targetMetricName' => 'alias_field_name_agg_func'
]
],
'sourceField' => 'log_obj.numeric_field',
'targetBaseMetricName' => 'alias_field_name'
]
],
'metricLabels' => [
[
'sourceField' => 'log_obj.string_value',
'targetLabel' => 'alias_label_name'
]
],
'spansQuery' => [
'actionFilters' => [
'myAction'
],
'applicationnameFilters' => [
'myApp'
],
'lucene' => 'applicationName:myApp',
'serviceFilters' => [
'myService'
],
'subsystemnameFilters' => [
'mySubsystem'
]
],
'updateTime' => '2022-06-30T12:30:00Z\''
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2"
payload := strings.NewReader("{\n \"name\": \"Service_catalog_latency\",\n \"createTime\": \"2022-06-30T12:30:00Z'\",\n \"description\": \"avg and max the latency of catalog service\",\n \"id\": \"d6a3658e-78d2-47d0-9b81-b2c551f01b09\",\n \"isInternal\": true,\n \"metricFields\": [\n {\n \"aggregations\": [\n {\n \"enabled\": true,\n \"none\": {},\n \"targetMetricName\": \"alias_field_name_agg_func\"\n }\n ],\n \"sourceField\": \"log_obj.numeric_field\",\n \"targetBaseMetricName\": \"alias_field_name\"\n }\n ],\n \"metricLabels\": [\n {\n \"sourceField\": \"log_obj.string_value\",\n \"targetLabel\": \"alias_label_name\"\n }\n ],\n \"spansQuery\": {\n \"actionFilters\": [\n \"myAction\"\n ],\n \"applicationnameFilters\": [\n \"myApp\"\n ],\n \"lucene\": \"applicationName:myApp\",\n \"serviceFilters\": [\n \"myService\"\n ],\n \"subsystemnameFilters\": [\n \"mySubsystem\"\n ]\n },\n \"updateTime\": \"2022-06-30T12:30:00Z'\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Service_catalog_latency\",\n \"createTime\": \"2022-06-30T12:30:00Z'\",\n \"description\": \"avg and max the latency of catalog service\",\n \"id\": \"d6a3658e-78d2-47d0-9b81-b2c551f01b09\",\n \"isInternal\": true,\n \"metricFields\": [\n {\n \"aggregations\": [\n {\n \"enabled\": true,\n \"none\": {},\n \"targetMetricName\": \"alias_field_name_agg_func\"\n }\n ],\n \"sourceField\": \"log_obj.numeric_field\",\n \"targetBaseMetricName\": \"alias_field_name\"\n }\n ],\n \"metricLabels\": [\n {\n \"sourceField\": \"log_obj.string_value\",\n \"targetLabel\": \"alias_label_name\"\n }\n ],\n \"spansQuery\": {\n \"actionFilters\": [\n \"myAction\"\n ],\n \"applicationnameFilters\": [\n \"myApp\"\n ],\n \"lucene\": \"applicationName:myApp\",\n \"serviceFilters\": [\n \"myService\"\n ],\n \"subsystemnameFilters\": [\n \"mySubsystem\"\n ]\n },\n \"updateTime\": \"2022-06-30T12:30:00Z'\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/4/events2metrics/events2metrics/v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Service_catalog_latency\",\n \"createTime\": \"2022-06-30T12:30:00Z'\",\n \"description\": \"avg and max the latency of catalog service\",\n \"id\": \"d6a3658e-78d2-47d0-9b81-b2c551f01b09\",\n \"isInternal\": true,\n \"metricFields\": [\n {\n \"aggregations\": [\n {\n \"enabled\": true,\n \"none\": {},\n \"targetMetricName\": \"alias_field_name_agg_func\"\n }\n ],\n \"sourceField\": \"log_obj.numeric_field\",\n \"targetBaseMetricName\": \"alias_field_name\"\n }\n ],\n \"metricLabels\": [\n {\n \"sourceField\": \"log_obj.string_value\",\n \"targetLabel\": \"alias_label_name\"\n }\n ],\n \"spansQuery\": {\n \"actionFilters\": [\n \"myAction\"\n ],\n \"applicationnameFilters\": [\n \"myApp\"\n ],\n \"lucene\": \"applicationName:myApp\",\n \"serviceFilters\": [\n \"myService\"\n ],\n \"subsystemnameFilters\": [\n \"mySubsystem\"\n ]\n },\n \"updateTime\": \"2022-06-30T12:30:00Z'\"\n}"
response = http.request(request)
puts response.read_body{
"e2m": {
"name": "Service_catalog_latency",
"createTime": "2022-06-30T12:30:00Z'",
"description": "avg and max the latency of catalog service",
"id": "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
"isInternal": true,
"logsQuery": {
"alias": "new_query",
"applicationnameFilters": [
"app_name"
],
"lucene": "log_obj.numeric_field: [50 TO 100]",
"severityFilters": [],
"subsystemnameFilters": [
"sub_name"
]
},
"metricFields": [
{
"aggregations": [
{
"enabled": true,
"none": {},
"targetMetricName": "alias_field_name_agg_func"
}
],
"sourceField": "log_obj.numeric_field",
"targetBaseMetricName": "alias_field_name"
}
],
"metricLabels": [
{
"sourceField": "log_obj.string_value",
"targetLabel": "alias_label_name"
}
],
"permutations": {
"hasExceededLimit": true,
"limit": 30000
},
"updateTime": "2022-06-30T12:30:00Z'"
}
}Authorizations
API key authentication
Body
application/json
- E2M
- E2M
This data structure represents an Event to Metrics (E2M) object.
Example:
"Service_catalog_latency"
Available options:
E2M_TYPE_UNSPECIFIED, E2M_TYPE_LOGS2METRICS, E2M_TYPE_SPANS2METRICS Example:
"2022-06-30T12:30:00Z'"
Example:
"avg and max the latency of catalog service"
Required string length:
36Pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Example:
"d6a3658e-78d2-47d0-9b81-b2c551f01b09"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
This data structure represents the limit of events2metrics permutations and if the limit was exceeded
Show child attributes
Show child attributes
This data structure represents a query for spans.
Show child attributes
Show child attributes
Example:
"2022-06-30T12:30:00Z'"
Response
200 - application/json
This data structure is obtained when replacing an existing event to metric definition
This data structure represents an Event to Metrics (E2M) object.
- E2M
- E2M
Show child attributes
Show child attributes
Was this page helpful?
⌘I