Create a view service
curl --request POST \
--url https://api.coralogix.com/mgmt/openapi/5/data-exploration/views/v1/views \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Logs view",
"timeSelection": {
"quickSelection": {
"seconds": 3600,
"caption": "Last Hour"
}
},
"filters": {
"filters": [
{
"name": "applicationName",
"selectedValues": {}
}
]
},
"folderId": "3dc02998-0b50-4ea8-b68a-4779d716fa1f"
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/5/data-exploration/views/v1/views"
payload = {
"name": "Logs view",
"timeSelection": { "quickSelection": {
"seconds": 3600,
"caption": "Last Hour"
} },
"filters": { "filters": [
{
"name": "applicationName",
"selectedValues": {}
}
] },
"folderId": "3dc02998-0b50-4ea8-b68a-4779d716fa1f"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Logs view',
timeSelection: {quickSelection: {seconds: 3600, caption: 'Last Hour'}},
filters: {filters: [{name: 'applicationName', selectedValues: {}}]},
folderId: '3dc02998-0b50-4ea8-b68a-4779d716fa1f'
})
};
fetch('https://api.coralogix.com/mgmt/openapi/5/data-exploration/views/v1/views', 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/5/data-exploration/views/v1/views",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Logs view',
'timeSelection' => [
'quickSelection' => [
'seconds' => 3600,
'caption' => 'Last Hour'
]
],
'filters' => [
'filters' => [
[
'name' => 'applicationName',
'selectedValues' => [
]
]
]
],
'folderId' => '3dc02998-0b50-4ea8-b68a-4779d716fa1f'
]),
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/5/data-exploration/views/v1/views"
payload := strings.NewReader("{\n \"name\": \"Logs view\",\n \"timeSelection\": {\n \"quickSelection\": {\n \"seconds\": 3600,\n \"caption\": \"Last Hour\"\n }\n },\n \"filters\": {\n \"filters\": [\n {\n \"name\": \"applicationName\",\n \"selectedValues\": {}\n }\n ]\n },\n \"folderId\": \"3dc02998-0b50-4ea8-b68a-4779d716fa1f\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.coralogix.com/mgmt/openapi/5/data-exploration/views/v1/views")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Logs view\",\n \"timeSelection\": {\n \"quickSelection\": {\n \"seconds\": 3600,\n \"caption\": \"Last Hour\"\n }\n },\n \"filters\": {\n \"filters\": [\n {\n \"name\": \"applicationName\",\n \"selectedValues\": {}\n }\n ]\n },\n \"folderId\": \"3dc02998-0b50-4ea8-b68a-4779d716fa1f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/5/data-exploration/views/v1/views")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Logs view\",\n \"timeSelection\": {\n \"quickSelection\": {\n \"seconds\": 3600,\n \"caption\": \"Last Hour\"\n }\n },\n \"filters\": {\n \"filters\": [\n {\n \"name\": \"applicationName\",\n \"selectedValues\": {}\n }\n ]\n },\n \"folderId\": \"3dc02998-0b50-4ea8-b68a-4779d716fa1f\"\n}"
response = http.request(request)
puts response.read_body{
"filters": {
"filters": [
{
"name": "applicationName",
"selectedValues": {
"demo": true
}
},
{
"name": "subsystemName",
"selectedValues": {
"demo": true
}
},
{
"name": "operationName",
"selectedValues": {
"demo": true
}
},
{
"name": "serviceName",
"selectedValues": {
"demo": true
}
},
{
"name": "severity",
"selectedValues": {
"demo": true
}
}
]
},
"id": 52,
"name": "Logs view",
"searchQuery": {
"query": "logs"
},
"timeSelection": {
"customSelection": {
"fromTime": "2024-01-25T11:31:43.152Z",
"toTime": "2024-01-25T11:37:13.238Z"
}
}
}Views Service
Create a view service
Creates a new view
Create a view service
curl --request POST \
--url https://api.coralogix.com/mgmt/openapi/5/data-exploration/views/v1/views \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Logs view",
"timeSelection": {
"quickSelection": {
"seconds": 3600,
"caption": "Last Hour"
}
},
"filters": {
"filters": [
{
"name": "applicationName",
"selectedValues": {}
}
]
},
"folderId": "3dc02998-0b50-4ea8-b68a-4779d716fa1f"
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/5/data-exploration/views/v1/views"
payload = {
"name": "Logs view",
"timeSelection": { "quickSelection": {
"seconds": 3600,
"caption": "Last Hour"
} },
"filters": { "filters": [
{
"name": "applicationName",
"selectedValues": {}
}
] },
"folderId": "3dc02998-0b50-4ea8-b68a-4779d716fa1f"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Logs view',
timeSelection: {quickSelection: {seconds: 3600, caption: 'Last Hour'}},
filters: {filters: [{name: 'applicationName', selectedValues: {}}]},
folderId: '3dc02998-0b50-4ea8-b68a-4779d716fa1f'
})
};
fetch('https://api.coralogix.com/mgmt/openapi/5/data-exploration/views/v1/views', 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/5/data-exploration/views/v1/views",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Logs view',
'timeSelection' => [
'quickSelection' => [
'seconds' => 3600,
'caption' => 'Last Hour'
]
],
'filters' => [
'filters' => [
[
'name' => 'applicationName',
'selectedValues' => [
]
]
]
],
'folderId' => '3dc02998-0b50-4ea8-b68a-4779d716fa1f'
]),
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/5/data-exploration/views/v1/views"
payload := strings.NewReader("{\n \"name\": \"Logs view\",\n \"timeSelection\": {\n \"quickSelection\": {\n \"seconds\": 3600,\n \"caption\": \"Last Hour\"\n }\n },\n \"filters\": {\n \"filters\": [\n {\n \"name\": \"applicationName\",\n \"selectedValues\": {}\n }\n ]\n },\n \"folderId\": \"3dc02998-0b50-4ea8-b68a-4779d716fa1f\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.coralogix.com/mgmt/openapi/5/data-exploration/views/v1/views")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Logs view\",\n \"timeSelection\": {\n \"quickSelection\": {\n \"seconds\": 3600,\n \"caption\": \"Last Hour\"\n }\n },\n \"filters\": {\n \"filters\": [\n {\n \"name\": \"applicationName\",\n \"selectedValues\": {}\n }\n ]\n },\n \"folderId\": \"3dc02998-0b50-4ea8-b68a-4779d716fa1f\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/5/data-exploration/views/v1/views")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Logs view\",\n \"timeSelection\": {\n \"quickSelection\": {\n \"seconds\": 3600,\n \"caption\": \"Last Hour\"\n }\n },\n \"filters\": {\n \"filters\": [\n {\n \"name\": \"applicationName\",\n \"selectedValues\": {}\n }\n ]\n },\n \"folderId\": \"3dc02998-0b50-4ea8-b68a-4779d716fa1f\"\n}"
response = http.request(request)
puts response.read_body{
"filters": {
"filters": [
{
"name": "applicationName",
"selectedValues": {
"demo": true
}
},
{
"name": "subsystemName",
"selectedValues": {
"demo": true
}
},
{
"name": "operationName",
"selectedValues": {
"demo": true
}
},
{
"name": "serviceName",
"selectedValues": {
"demo": true
}
},
{
"name": "severity",
"selectedValues": {
"demo": true
}
}
]
},
"id": 52,
"name": "Logs view",
"searchQuery": {
"query": "logs"
},
"timeSelection": {
"customSelection": {
"fromTime": "2024-01-25T11:31:43.152Z",
"toTime": "2024-01-25T11:37:13.238Z"
}
}
}Authorizations
API key authentication
Body
application/json
View folder.
View name
Required string length:
1 - 250Pattern:
^[\s\S]*$Example:
"Logs view"
Time selection.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Selected filters.
Show child attributes
Show child attributes
Unique identifier for folders
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:
"3dc02998-0b50-4ea8-b68a-4779d716fa1f"
Search query.
Show child attributes
Show child attributes
View type.
Available options:
VIEW_TYPE_UNSPECIFIED, VIEW_TYPE_LOGS, VIEW_TYPE_TEMPLATES, VIEW_TYPE_ARCHIVE_LOGS, VIEW_TYPE_ARCHIVE_TEMPLATES Response
200 - application/json
Response for views.
id
Required range:
1 <= x <= 2147483647Example:
52
View name
Required string length:
1 - 250Pattern:
^[\s\S]*$Example:
"Logs view"
Time selection.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Selected filters.
Show child attributes
Show child attributes
Unique identifier for folders
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:
"3dc02998-0b50-4ea8-b68a-4779d716fa1f"
The is compact mode.
Search query.
Show child attributes
Show child attributes
View type.
Available options:
VIEW_TYPE_UNSPECIFIED, VIEW_TYPE_LOGS, VIEW_TYPE_TEMPLATES, VIEW_TYPE_ARCHIVE_LOGS, VIEW_TYPE_ARCHIVE_TEMPLATES Was this page helpful?
⌘I