Introduction
IBM® Cloud Logs is a scalable logging service that persists logs and provides users with capabilities for querying, tailing, and visualizing logs.
Go SDK is available to make it easier to programmatically access the API from your code. The client libraries that are provided by the SDK implement best practices for using the API and reduce the amount of code that you need to write. The tab for Go includes code examples that demonstrate how to use the client libraries. For more information about using the SDK, see the IBM Cloud SDK Common project on GitHub.
Installing the Go SDK
Go modules (recommended): Add the following import in your code, and then run go build
or go mod tidy
import (
"github.com/IBM/logs-go-sdk/logsv0"
)
Go get
go get -u github.com/IBM/logs-go-sdk
View on GitHub
Endpoint URLs
The API endpoint URL is unique per region for an instance of IBM Cloud Logs. For example, when IBM Cloud Logs is hosted in Madrid (eu-es), the base URL is https://{instance_ID}.api.eu-es.logs.cloud.ibm.com
The version information is appended to the base URL to access resources. For example /v1, resulting in the URL https://{instance_ID}.api.eu-es.logs.cloud.ibm.com/v1 for Madrid (eu-es).
Base URL
https://{instance_ID}.api.{region}.logs.cloud.ibm.com
Example API request
curl -X {request_method} -H "Authorization: Bearer {bearer_token}" -H "Accept: application/json" [--data "{request_body}"] "https://{instance_ID}.api.{region}.logs.cloud.ibm.com/{method_endpoint}"
Replace {bearer_token}
, {request_method}
, {method_endpoint}
and [optional] {request_body}
in this example with the values for your particular API call.
Authentication
Authorization to the IBM Cloud Logs service REST API is enforced by an IBM Cloud® Identity and Access Management (IAM) access token. The token is used to determine the actions that a user or service ID has access to when they use the API.
Retrieving an access token is supported using an IAM Trusted Profile or IAM API key.
-
To request an access token with a Trusted Profile from within your IBM Cloud Kubernetes Service or Red Hat OpenShift cluster, run the following command:
curl -X POST \ -H "Content-Type: application/x-www-form-urlencoded" \ --data "grant_type=urn:ibm:params:oauth:grant-type:cr-token" \ --data "profile_id={trusted_profile_id}" \ --data-urlencode "cr_token@{path_to_token}" \ https://iam.cloud.ibm.com/identity/token
Replace
{trusted_profile_id}
and{path_to_token}
with the correct values for your environment. -
To request an access token with an IAM api_key, run the following command:
curl -X POST \ -H 'Content-Type: application/x-www-form-urlencoded' \ --data "grant_type=urn:ibm:params:oauth:grant-type:apikey" \ --data "apikey=${IAM_API_KEY}" \ "https://iam.cloud.ibm.com/identity/token"
Replace
{IAM_API_KEY}
with your IAM API key.
The access token is provided in the returned JSON data in the field .access_token
.
Error handling
The IBM Cloud Logs service uses standard HTTP response codes to indicate whether a method completed successfully. A 200
response always indicates success. A 400
type response indicates that a parameter validation failed and can occur if required parameters are missing or if any parameter values are invalid. A 401
or 403
response indicates that the incoming request did not contain valid authentication information. A 500
type response indicates an internal server error that is seen in an unexpected error situation.
The IBM Cloud Logs REST APIs return standard HTTP status codes to indicate the success or failure of a request. The format of the response is represented in JSON as follows:
{
"errors": [
{
"code": "not_authorized",
"message": "The specified token does not have authority to create a tenant."
}
],
"status_code": 403
}
If an operation cannot be fulfilled, an appropriate 400 or 500 series HTTP response is returned from the server. The operations that are defined in the Reference
section describe example errors that might be returned from a failed request. All responses from the Identity Services REST API are in JSON format.
The following table shows the potential error codes the API might return.
HTTP Error Code | Description | Recovery |
---|---|---|
200 |
Success | The request was successful. |
201 |
Created | The resource was successfully created. |
204 |
No Content | The request was successful. No response body is provided. |
400 |
Bad Request | The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request. |
401 |
Unauthorized | You are not authorized to make this request. The token is either missing or expired. Get a new valid token and try again. |
403 |
Forbidden | The supplied authentication is not authorized to perform the operation. If this error persists, contact the account owner to check your permissions. |
404 |
Not Found | The requested resource can't be found. |
408 |
Request Timeout | The connection to the server timed out. Wait a few minutes, then try again. |
409 |
conflict | The requested resource conflicts with an already existing resource. |
415 |
Bad Request | Missing or wrong header |
429 |
Rate limit exceeded | Reduce the rate of requests or Wait a few minutes, then try again. |
500 |
Internal error | Error that is seen in an unexpected error situation. |
Methods
Get an alert by ID
Get an alert by ID
Get an alert by ID.
GET /v1/alerts/{id}
(logs *LogsV0) GetAlert(getAlertOptions *GetAlertOptions) (result *Alert, response *core.DetailedResponse, err error)
(logs *LogsV0) GetAlertWithContext(ctx context.Context, getAlertOptions *GetAlertOptions) (result *Alert, response *core.DetailedResponse, err error)
Request
Instantiate the GetAlertOptions
struct and set the fields to provide parameter values for the GetAlert
method.
Path Parameters
Alert ID
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetAlert options.
Alert ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/alerts/${id}"
getAlertOptions := logsService.NewGetAlertOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), ) alert, response, err := logsService.GetAlert(getAlertOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(alert, "", " ") fmt.Println(string(b))
Response
Alert resource model
Alert ID
Possible values: length = 36, Value must match regular expression
^[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
Alert name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Unique count alert
Alert is active
Example:
true
Alert severity
Possible values: [
info_or_unspecified
,warning
,critical
,error
]Example:
error
Alert condition
Alert notification groups
Possible values: 1 ≤ number of items ≤ 10
Alert filters
Alert description
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Example of unique count alert from terraform
Alert expiration date
When should the alert be active
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Examples:[ "message", "hostname" ]
The Meta labels to add to the alert
Possible values: 0 ≤ number of items ≤ 200
The Meta labels to add to the alert as string with ':' separator
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Examples:[ "env:dev" ]
Alert unique identifier
Possible values: length = 36, Value must match regular expression
^[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
Incident settings, will create the incident based on this configuration
Alert resource model.
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"sunday",
"monday_or_unspecified",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday"
],
"range": {
"end": {
"hours": 18,
"minutes": 29,
"seconds": 59
},
"start": {
"hours": 18,
"minutes": 30
}
}
}
]
},
"condition": {
"more_than": {
"evaluation_window": "rolling_or_unspecified",
"parameters": {
"group_by": [
"coralogix.metadata.applicationName"
],
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 1,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Alert if the number of logs reaches a threshold",
"filters": {
"filter_type": "text_or_unspecified",
"metadata": {},
"severities": [
"info"
],
"text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
},
"id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 300,
"use_as_notification_settings": true
},
"is_active": true,
"meta_labels": [
{
"key": "env",
"value": "dev"
}
],
"name": "Test alert",
"notification_groups": [
{
"group_by_fields": [
"coralogix.metadata.applicationName"
]
}
],
"severity": "info_or_unspecified",
"unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
}
Alert ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Alert name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Unique count alert
Alert description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Example of unique count alert from terraform
Alert is active.
Examples:true
Alert severity.
Possible values: [
info_or_unspecified
,warning
,critical
,error
]Examples:error
Alert expiration date.
- Expiration
Year.
Examples:2012
Month of the year.
Examples:12
Day of the month.
Examples:24
Alert condition.
- Condition
Condition for immediate standard alert.
Alert notification groups.
Possible values: 1 ≤ number of items ≤ 10
- NotificationGroups
Group by fields to group the values by.
Possible values: 0 ≤ number of items ≤ 20, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "cpu" ]
Webhook target settings for the the notification.
Possible values: 0 ≤ number of items ≤ 20
- Notifications
Webhook target settings for the the notification.
- AlertsV2AlertNotification
Retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Possible values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Integration ID.
Possible values: 0 ≤ value ≤ 4294967295
Examples:123
Alert filters.
- Filters
The severity of the logs to filter.
Possible values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
The metadata filters.
- Metadata
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:monitorQuery
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The ratio alerts.
Possible values: 0 ≤ number of items ≤ 4096
- RatioAlerts
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:TopLevelAlert
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The severities to filter.
Possible values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The group by fields.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "Host", "Thread" ]
The type of the filter.
Possible values: [
text_or_unspecified
,template
,ratio
,unique_count
,time_relative
,metric
,flow
]Examples:flow
When should the alert be active.
- ActiveWhen
Activity timeframes of the alert.
Possible values: 1 ≤ number of items ≤ 30
- Timeframes
Days of the week for activity.
Possible values: [
monday_or_unspecified
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
]Possible values: 1 ≤ number of items ≤ 30
Examples:[ "sunday" ]
Time range in the day of the week.
- Range
Start time.
- Start
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
Start time.
- End
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "message", "hostname" ]
The Meta labels to add to the alert.
Possible values: 0 ≤ number of items ≤ 200
- MetaLabels
The key of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:ColorLabel
The value of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Red
The Meta labels to add to the alert as string with ':' separator.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "env:dev" ]
Alert unique identifier.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Incident settings, will create the incident based on this configuration.
- IncidentSettings
The retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Possible values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Use these settings for all notificaion webhook.
Examples:true
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ] } ], "severity": "info_or_unspecified", "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4" }
{ "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ] } ], "severity": "info_or_unspecified", "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Update an alert
Update an alert
Update an alert.
PUT /v1/alerts/{id}
(logs *LogsV0) UpdateAlert(updateAlertOptions *UpdateAlertOptions) (result *Alert, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdateAlertWithContext(ctx context.Context, updateAlertOptions *UpdateAlertOptions) (result *Alert, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateAlertOptions
struct and set the fields to provide parameter values for the UpdateAlert
method.
Path Parameters
Alert ID
Possible values: length = 36, Value must match regular expression
^[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
Alert to create/update
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"sunday",
"monday_or_unspecified",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday"
],
"range": {
"end": {
"hours": 18,
"minutes": 29,
"seconds": 59
},
"start": {
"hours": 18,
"minutes": 30,
"seconds": 0
}
}
}
]
},
"condition": {
"more_than": {
"evaluation_window": "rolling_or_unspecified",
"parameters": {
"cardinality_fields": [],
"group_by": [
"coralogix.metadata.applicationName"
],
"ignore_infinity": true,
"notify_group_by_only_alerts": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 1,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Alert if the number of logs reaches a threshold",
"filters": {
"filter_type": "text_or_unspecified",
"metadata": {},
"ratio_alerts": [],
"severities": [
"info"
],
"text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
},
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 300,
"use_as_notification_settings": true
},
"is_active": true,
"meta_labels": [
{
"key": "env",
"value": "dev"
}
],
"meta_labels_strings": [],
"name": "Test alert",
"notification_groups": [
{
"group_by_fields": [
"coralogix.metadata.applicationName"
],
"notifications": []
}
],
"severity": "info_or_unspecified"
}
Alert name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Unique count alert
Alert is active
Example:
true
Alert severity
Allowable values: [
info_or_unspecified
,warning
,critical
,error
]Example:
error
Alert condition
Alert notification groups
Possible values: 1 ≤ number of items ≤ 10
Alert filters
Alert description
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Example of unique count alert from terraform
Alert expiration date
When should the alert be active
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Examples:[ "id", "name" ]
The Meta labels to add to the alert
Possible values: 0 ≤ number of items ≤ 200
The Meta labels to add to the alert as string with ':' separator
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Examples:[ "env:dev" ]
Incident settings, will create the incident based on this configuration
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The UpdateAlert options.
Alert ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Alert name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Test alert
Alert is active.
Examples:true
Alert severity.
Allowable values: [
info_or_unspecified
,warning
,critical
,error
]Examples:info_or_unspecified
Alert condition.
- Condition
Condition for immediate standard alert.
Alert notification groups.
Possible values: 1 ≤ number of items ≤ 10
Examples:[ { "group_by_fields": [ "coralogix.metadata.applicationName" ], "notifications": [] } ]
- NotificationGroups
Group by fields to group the values by.
Possible values: 0 ≤ number of items ≤ 20, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "cpu" ]
Webhook target settings for the the notification.
Possible values: 0 ≤ number of items ≤ 20
- Notifications
Webhook target settings for the the notification.
- AlertsV2AlertNotification
Retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Allowable values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Integration ID.
Possible values: 0 ≤ value ≤ 4294967295
Examples:123
Alert filters.
Examples:{ "filter_type": "text_or_unspecified", "metadata": {}, "ratio_alerts": [], "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }
- Filters
The severity of the logs to filter.
Allowable values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
The metadata filters.
- Metadata
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:monitorQuery
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The ratio alerts.
Possible values: 0 ≤ number of items ≤ 4096
- RatioAlerts
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:TopLevelAlert
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The severities to filter.
Allowable values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The group by fields.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "Host", "Thread" ]
The type of the filter.
Allowable values: [
text_or_unspecified
,template
,ratio
,unique_count
,time_relative
,metric
,flow
]Examples:flow
Alert description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Alert if the number of logs reaches a threshold
Alert expiration date.
- Expiration
Year.
Examples:2012
Month of the year.
Examples:12
Day of the month.
Examples:24
When should the alert be active.
Examples:{ "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30, "seconds": 0 } } } ] }
- ActiveWhen
Activity timeframes of the alert.
Possible values: 1 ≤ number of items ≤ 30
- Timeframes
Days of the week for activity.
Allowable values: [
monday_or_unspecified
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
]Possible values: 1 ≤ number of items ≤ 30
Examples:[ "sunday" ]
Time range in the day of the week.
- Range
Start time.
- Start
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
Start time.
- End
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
The Meta labels to add to the alert.
Possible values: 0 ≤ number of items ≤ 200
Examples:[ { "key": "env", "value": "dev" } ]
- MetaLabels
The key of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:ColorLabel
The value of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Red
The Meta labels to add to the alert as string with ':' separator.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[]
Incident settings, will create the incident based on this configuration.
Examples:{ "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }
- IncidentSettings
The retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Allowable values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Use these settings for all notificaion webhook.
Examples:true
curl -X PUT --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30, "seconds": 0 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "cardinality_fields": [], "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "notify_group_by_only_alerts": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "ratio_alerts": [], "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "meta_labels_strings": [], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ], "notifications": [] } ], "severity": "info_or_unspecified" }' "${base_url}/v1/alerts/${id}"
alertsV2ConditionParametersModel := &logsv0.AlertsV2ConditionParameters{ Threshold: core.Float64Ptr(float64(1)), Timeframe: core.StringPtr("timeframe_10_min"), GroupBy: []string{"coralogix.metadata.applicationName"}, IgnoreInfinity: core.BoolPtr(true), RelativeTimeframe: core.StringPtr("hour_or_unspecified"), CardinalityFields: []string{}, } alertsV2MoreThanConditionModel := &logsv0.AlertsV2MoreThanCondition{ Parameters: alertsV2ConditionParametersModel, EvaluationWindow: core.StringPtr("rolling_or_unspecified"), } alertsV2AlertConditionModel := &logsv0.AlertsV2AlertConditionConditionMoreThan{ MoreThan: alertsV2MoreThanConditionModel, } alertsV2AlertNotificationModel := &logsv0.AlertsV2AlertNotificationIntegrationTypeIntegrationID{ } alertsV2AlertNotificationGroupsModel := &logsv0.AlertsV2AlertNotificationGroups{ GroupByFields: []string{"coralogix.metadata.applicationName"}, Notifications: []logsv0.AlertsV2AlertNotificationIntf{alertsV2AlertNotificationModel}, } alertsV1AlertFiltersMetadataFiltersModel := &logsv0.AlertsV1AlertFiltersMetadataFilters{ } alertsV1AlertFiltersModel := &logsv0.AlertsV1AlertFilters{ Severities: []string{"info"}, Metadata: alertsV1AlertFiltersMetadataFiltersModel, Text: core.StringPtr("initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"), FilterType: core.StringPtr("text_or_unspecified"), } alertsV1TimeModel := &logsv0.AlertsV1Time{ Hours: core.Int64Ptr(int64(18)), Minutes: core.Int64Ptr(int64(30)), Seconds: core.Int64Ptr(int64(0)), } alertsV1TimeRangeModel := &logsv0.AlertsV1TimeRange{ Start: alertsV1TimeModel, End: alertsV1TimeModel, } alertsV1AlertActiveTimeframeModel := &logsv0.AlertsV1AlertActiveTimeframe{ DaysOfWeek: []string{"sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday"}, Range: alertsV1TimeRangeModel, } alertsV1AlertActiveWhenModel := &logsv0.AlertsV1AlertActiveWhen{ Timeframes: []logsv0.AlertsV1AlertActiveTimeframe{*alertsV1AlertActiveTimeframeModel}, } alertsV1MetaLabelModel := &logsv0.AlertsV1MetaLabel{ Key: core.StringPtr("env"), Value: core.StringPtr("dev"), } alertsV2AlertIncidentSettingsModel := &logsv0.AlertsV2AlertIncidentSettings{ RetriggeringPeriodSeconds: core.Int64Ptr(int64(300)), NotifyOn: core.StringPtr("triggered_only"), UseAsNotificationSettings: core.BoolPtr(true), } updateAlertOptions := logsService.NewUpdateAlertOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), "Test alert", true, "info_or_unspecified", alertsV2AlertConditionModel, []logsv0.AlertsV2AlertNotificationGroups{*alertsV2AlertNotificationGroupsModel}, alertsV1AlertFiltersModel, ) updateAlertOptions.SetDescription("Alert if the number of logs reaches a threshold") updateAlertOptions.SetActiveWhen(alertsV1AlertActiveWhenModel) updateAlertOptions.SetMetaLabels([]logsv0.AlertsV1MetaLabel{*alertsV1MetaLabelModel}) updateAlertOptions.SetMetaLabelsStrings([]string{}) updateAlertOptions.SetIncidentSettings(alertsV2AlertIncidentSettingsModel) alert, response, err := logsService.UpdateAlert(updateAlertOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(alert, "", " ") fmt.Println(string(b))
Response
Alert resource model
Alert ID
Possible values: length = 36, Value must match regular expression
^[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
Alert name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Unique count alert
Alert is active
Example:
true
Alert severity
Possible values: [
info_or_unspecified
,warning
,critical
,error
]Example:
error
Alert condition
Alert notification groups
Possible values: 1 ≤ number of items ≤ 10
Alert filters
Alert description
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Example of unique count alert from terraform
Alert expiration date
When should the alert be active
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Examples:[ "message", "hostname" ]
The Meta labels to add to the alert
Possible values: 0 ≤ number of items ≤ 200
The Meta labels to add to the alert as string with ':' separator
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Examples:[ "env:dev" ]
Alert unique identifier
Possible values: length = 36, Value must match regular expression
^[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
Incident settings, will create the incident based on this configuration
Alert resource model.
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"sunday",
"monday_or_unspecified",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday"
],
"range": {
"end": {
"hours": 18,
"minutes": 29,
"seconds": 59
},
"start": {
"hours": 18,
"minutes": 30
}
}
}
]
},
"condition": {
"more_than": {
"evaluation_window": "rolling_or_unspecified",
"parameters": {
"group_by": [
"coralogix.metadata.applicationName"
],
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 1,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Alert if the number of logs reaches a threshold",
"filters": {
"filter_type": "text_or_unspecified",
"metadata": {},
"severities": [
"info"
],
"text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
},
"id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 300,
"use_as_notification_settings": true
},
"is_active": true,
"meta_labels": [
{
"key": "env",
"value": "dev"
}
],
"name": "Test alert",
"notification_groups": [
{
"group_by_fields": [
"coralogix.metadata.applicationName"
]
}
],
"severity": "info_or_unspecified",
"unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
}
Alert ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Alert name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Unique count alert
Alert description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Example of unique count alert from terraform
Alert is active.
Examples:true
Alert severity.
Possible values: [
info_or_unspecified
,warning
,critical
,error
]Examples:error
Alert expiration date.
- Expiration
Year.
Examples:2012
Month of the year.
Examples:12
Day of the month.
Examples:24
Alert condition.
- Condition
Condition for immediate standard alert.
Alert notification groups.
Possible values: 1 ≤ number of items ≤ 10
- NotificationGroups
Group by fields to group the values by.
Possible values: 0 ≤ number of items ≤ 20, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "cpu" ]
Webhook target settings for the the notification.
Possible values: 0 ≤ number of items ≤ 20
- Notifications
Webhook target settings for the the notification.
- AlertsV2AlertNotification
Retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Possible values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Integration ID.
Possible values: 0 ≤ value ≤ 4294967295
Examples:123
Alert filters.
- Filters
The severity of the logs to filter.
Possible values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
The metadata filters.
- Metadata
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:monitorQuery
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The ratio alerts.
Possible values: 0 ≤ number of items ≤ 4096
- RatioAlerts
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:TopLevelAlert
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The severities to filter.
Possible values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The group by fields.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "Host", "Thread" ]
The type of the filter.
Possible values: [
text_or_unspecified
,template
,ratio
,unique_count
,time_relative
,metric
,flow
]Examples:flow
When should the alert be active.
- ActiveWhen
Activity timeframes of the alert.
Possible values: 1 ≤ number of items ≤ 30
- Timeframes
Days of the week for activity.
Possible values: [
monday_or_unspecified
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
]Possible values: 1 ≤ number of items ≤ 30
Examples:[ "sunday" ]
Time range in the day of the week.
- Range
Start time.
- Start
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
Start time.
- End
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "message", "hostname" ]
The Meta labels to add to the alert.
Possible values: 0 ≤ number of items ≤ 200
- MetaLabels
The key of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:ColorLabel
The value of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Red
The Meta labels to add to the alert as string with ':' separator.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "env:dev" ]
Alert unique identifier.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Incident settings, will create the incident based on this configuration.
- IncidentSettings
The retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Possible values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Use these settings for all notificaion webhook.
Examples:true
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ] } ], "severity": "info_or_unspecified", "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4" }
{ "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ] } ], "severity": "info_or_unspecified", "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Delete an alert
Delete an alert
Delete an alert.
DELETE /v1/alerts/{id}
(logs *LogsV0) DeleteAlert(deleteAlertOptions *DeleteAlertOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteAlertWithContext(ctx context.Context, deleteAlertOptions *DeleteAlertOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteAlertOptions
struct and set the fields to provide parameter values for the DeleteAlert
method.
Path Parameters
Alert ID
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteAlert options.
Alert ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
curl -X DELETE --location --header "Authorization: Bearer ${iam_token}" "${base_url}/v1/alerts/${id}"
deleteAlertOptions := logsService.NewDeleteAlertOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), ) response, err := logsService.DeleteAlert(deleteAlertOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteAlert(): %d\n", response.StatusCode) }
Response
Status Code
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
List alerts
List alerts
List alerts.
GET /v1/alerts
(logs *LogsV0) GetAlerts(getAlertsOptions *GetAlertsOptions) (result *AlertCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) GetAlertsWithContext(ctx context.Context, getAlertsOptions *GetAlertsOptions) (result *AlertCollection, response *core.DetailedResponse, err error)
Request
No Request Parameters
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/alerts"
getAlertsOptions := logsService.NewGetAlertsOptions() alertCollection, response, err := logsService.GetAlerts(getAlertsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(alertCollection, "", " ") fmt.Println(string(b))
Response
Alerts collection
Alerts
Possible values: 0 ≤ number of items ≤ 4096
Alerts collection.
{
"alerts": [
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"sunday",
"monday_or_unspecified",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday"
],
"range": {
"end": {
"hours": 18,
"minutes": 29,
"seconds": 59
},
"start": {
"hours": 18,
"minutes": 30
}
}
}
]
},
"condition": {
"more_than": {
"evaluation_window": "rolling_or_unspecified",
"parameters": {
"group_by": [
"coralogix.metadata.applicationName"
],
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 1,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Alert if the number of logs reaches a threshold",
"filters": {
"filter_type": "text_or_unspecified",
"metadata": {},
"severities": [
"info"
],
"text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
},
"id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 300,
"use_as_notification_settings": true
},
"is_active": true,
"meta_labels": [
{
"key": "env",
"value": "dev"
}
],
"name": "Test alert",
"notification_groups": [
{
"group_by_fields": [
"coralogix.metadata.applicationName"
]
}
],
"severity": "info_or_unspecified",
"unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
},
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"thursday",
"wednesday"
],
"range": {
"end": {
"hours": 18,
"minutes": 30
},
"start": {
"hours": 6,
"minutes": 30
}
}
}
]
},
"condition": {
"unique_count": {
"parameters": {
"cardinality_fields": [
"remote_addr_geoip.country_name"
],
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 2,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Example of unique count alert from terraform",
"filters": {
"filter_type": "unique_count",
"metadata": {},
"severities": [
"info"
]
},
"id": "5c334366-571a-4431-80ae-3086bf91c575",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 600,
"use_as_notification_settings": false
},
"is_active": true,
"name": "Unique count alert example",
"notification_groups": [
{
"notifications": [
{
"notify_on": "triggered_and_resolved",
"recipients": {
"emails": [
"example@coralogix.com"
]
},
"retriggering_period_seconds": 60
}
]
}
],
"severity": "warning",
"unique_identifier": "e6e01065-7eac-4f5f-8e24-2ee4c7122ab9"
},
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"thursday",
"wednesday"
],
"range": {
"end": {
"hours": 18,
"minutes": 30
},
"start": {
"hours": 6,
"minutes": 30
}
}
}
]
},
"condition": {
"unique_count": {
"parameters": {
"cardinality_fields": [
"remote_addr_geoip.country_name"
],
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 2,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Example of unique count alert from terraform",
"filters": {
"filter_type": "unique_count",
"metadata": {},
"severities": [
"info"
]
},
"id": "ffea3734-56eb-4f25-a59a-2d9889c71f46",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 600,
"use_as_notification_settings": false
},
"is_active": true,
"name": "Unique count alert example",
"notification_groups": [
{
"notifications": [
{
"notify_on": "triggered_and_resolved",
"recipients": {
"emails": [
"example@coralogix.com"
]
},
"retriggering_period_seconds": 60
}
]
}
],
"severity": "info_or_unspecified",
"unique_identifier": "39246ad5-19a0-43fd-aa76-e6ff075e864b"
},
{
"condition": {
"more_than_usual": {
"parameters": {
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 10,
"timeframe": "timeframe_5_min_or_unspecified"
}
}
},
"description": "OKTA audit extension pack",
"filters": {
"filter_type": "text_or_unspecified",
"metadata": {},
"text": "legacyEventType:\\\"login failed\\\""
},
"id": "b2f843d7-4721-4ce2-ac0d-ea0443bbe372",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 60,
"use_as_notification_settings": false
},
"is_active": true,
"name": "More than usual login failures",
"notification_groups": [
{}
],
"severity": "info_or_unspecified",
"show_in_insight": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 60
},
"unique_identifier": "4fa3710a-c91d-4d6e-8359-41a44c45a141"
},
{
"condition": {
"more_than_usual": {
"parameters": {
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 10,
"timeframe": "timeframe_5_min_or_unspecified"
}
}
},
"description": "OKTA audit extension pack",
"filters": {
"filter_type": "text_or_unspecified",
"metadata": {},
"text": "legacyEventType:\\\"login failed\\\""
},
"id": "1a02193d-856b-4f84-ab4e-9918ac136244",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 60,
"use_as_notification_settings": false
},
"is_active": true,
"name": "More than usual login failures",
"notification_groups": [
{}
],
"severity": "info_or_unspecified",
"show_in_insight": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 60
},
"unique_identifier": "bd851dfb-2aa4-4ed7-97ec-922f01f98036"
},
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"thursday",
"wednesday"
],
"range": {
"end": {
"hours": 18,
"minutes": 30
},
"start": {
"hours": 6,
"minutes": 30
}
}
}
]
},
"condition": {
"unique_count": {
"parameters": {
"cardinality_fields": [
"remote_addr_geoip.country_name"
],
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 2,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Example of unique count alert from terraform",
"filters": {
"filter_type": "unique_count",
"metadata": {},
"severities": [
"info"
]
},
"id": "29f24d53-f219-4245-a2b9-009e98bd8c4e",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 600,
"use_as_notification_settings": false
},
"is_active": true,
"name": "Unique count alert example",
"notification_groups": [
{
"notifications": [
{
"notify_on": "triggered_and_resolved",
"recipients": {
"emails": [
"example@coralogix.com"
]
},
"retriggering_period_seconds": 60
}
]
}
],
"severity": "info_or_unspecified",
"unique_identifier": "e09735d3-a472-4df7-9d2c-2bfe851c436e"
},
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"thursday",
"wednesday"
],
"range": {
"end": {
"hours": 18,
"minutes": 30
},
"start": {
"hours": 6,
"minutes": 30
}
}
}
]
},
"condition": {
"unique_count": {
"parameters": {
"cardinality_fields": [
"remote_addr_geoip.country_name"
],
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 2,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Example of unique count alert from terraform",
"filters": {
"filter_type": "unique_count",
"metadata": {},
"severities": [
"info"
]
},
"id": "3d57bc5b-28b3-4ffe-9ece-049457760edc",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 600,
"use_as_notification_settings": false
},
"is_active": true,
"name": "Unique count alert example",
"notification_groups": [
{
"notifications": [
{
"notify_on": "triggered_and_resolved",
"recipients": {
"emails": [
"example@coralogix.com"
]
},
"retriggering_period_seconds": 60
}
]
}
],
"severity": "info_or_unspecified",
"unique_identifier": "f6f8d470-7793-44d2-82ef-34f95f01b8fa"
},
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"monday_or_unspecified",
"wednesday"
],
"range": {
"end": {
"hours": 18,
"minutes": 30
},
"start": {
"hours": 6,
"minutes": 30
}
}
}
]
},
"condition": {
"unique_count": {
"parameters": {
"cardinality_fields": [
"remote_addr_geoip.country_name"
],
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 2,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Example of unique count alert from terraform",
"filters": {
"filter_type": "unique_count",
"metadata": {},
"severities": [
"info"
]
},
"id": "861320bc-33a1-4dfc-9180-0d0afecb68de",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 600,
"use_as_notification_settings": false
},
"is_active": true,
"name": "Unique count alert example",
"notification_groups": [
{
"notifications": [
{
"notify_on": "triggered_and_resolved",
"recipients": {
"emails": [
"example@coralogix.com"
]
},
"retriggering_period_seconds": 60
}
]
}
],
"severity": "info_or_unspecified",
"unique_identifier": "06facfcf-dfdd-49b0-8078-a07448d0cd54"
},
{
"active_when": {},
"condition": {
"more_than_usual": {
"parameters": {
"group_by": [
"access_mode"
],
"ignore_infinity": true,
"metric_alert_promql_parameters": {
"non_null_percentage": 10,
"promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
"sample_threshold_percentage": 20,
"swap_null_values": false
},
"relative_timeframe": "hour_or_unspecified",
"threshold": 0,
"timeframe": "timeframe_5_min_or_unspecified"
}
}
},
"description": "asd",
"filters": {
"filter_type": "metric",
"metadata": {}
},
"id": "060f9814-f7fe-4955-96fd-2c6e790a391b",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 900,
"use_as_notification_settings": true
},
"is_active": false,
"name": "test more than usual 112",
"notification_groups": [
{}
],
"severity": "info_or_unspecified",
"unique_identifier": "1ccd73dc-eb4b-437b-b2c1-273457b03424"
},
{
"active_when": {},
"condition": {
"more_than_usual": {
"parameters": {
"group_by": [
"access_mode"
],
"ignore_infinity": true,
"metric_alert_promql_parameters": {
"non_null_percentage": 10,
"promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
"sample_threshold_percentage": 20,
"swap_null_values": false
},
"relative_timeframe": "hour_or_unspecified",
"threshold": 0,
"timeframe": "timeframe_5_min_or_unspecified"
}
}
},
"description": "asd",
"filters": {
"filter_type": "metric",
"metadata": {}
},
"id": "70b27d7d-0c54-4f2f-8254-a9a828571fe9",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 900,
"use_as_notification_settings": true
},
"is_active": false,
"name": "test more than usual 12",
"notification_groups": [
{}
],
"severity": "info_or_unspecified",
"unique_identifier": "934260b6-cfcd-463a-b25f-54015411df6c"
},
{
"active_when": {},
"condition": {
"more_than_usual": {
"parameters": {
"group_by": [
"access_mode"
],
"ignore_infinity": true,
"metric_alert_promql_parameters": {
"non_null_percentage": 10,
"promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
"sample_threshold_percentage": 20,
"swap_null_values": false
},
"relative_timeframe": "hour_or_unspecified",
"threshold": 0,
"timeframe": "timeframe_5_min_or_unspecified"
}
}
},
"description": "asd",
"filters": {
"filter_type": "metric",
"metadata": {}
},
"id": "4c2132ca-2f2e-4ea5-8089-810ffad38f82",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 900,
"use_as_notification_settings": true
},
"is_active": false,
"name": "test more than usual 12",
"notification_groups": [
{}
],
"severity": "info_or_unspecified",
"unique_identifier": "f98c3d0e-9ed0-4b0d-a8c4-698ecbfd3c1c"
},
{
"active_when": {},
"condition": {
"more_than_usual": {
"parameters": {
"group_by": [
"access_mode"
],
"ignore_infinity": true,
"metric_alert_promql_parameters": {
"non_null_percentage": 10,
"promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
"sample_threshold_percentage": 20,
"swap_null_values": false
},
"relative_timeframe": "hour_or_unspecified",
"threshold": 0,
"timeframe": "timeframe_5_min_or_unspecified"
}
}
},
"description": "asd",
"filters": {
"filter_type": "metric",
"metadata": {}
},
"id": "ba301f45-c955-4cef-b8b7-fae3d4da26d6",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 900,
"use_as_notification_settings": true
},
"is_active": false,
"name": "test more than usual 12",
"notification_groups": [
{}
],
"severity": "info_or_unspecified",
"unique_identifier": "258464d8-e26b-4ecb-8b58-07138fe2b44d"
},
{
"active_when": {},
"condition": {
"more_than_usual": {
"parameters": {
"group_by": [
"access_mode"
],
"ignore_infinity": true,
"metric_alert_promql_parameters": {
"non_null_percentage": 10,
"promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
"sample_threshold_percentage": 20,
"swap_null_values": false
},
"relative_timeframe": "hour_or_unspecified",
"threshold": 0,
"timeframe": "timeframe_5_min_or_unspecified"
}
}
},
"description": "asd",
"filters": {
"filter_type": "metric",
"metadata": {}
},
"id": "a32c5827-d31d-4699-8701-c14d905d007b",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 900,
"use_as_notification_settings": true
},
"is_active": false,
"name": "test more than usual 12",
"notification_groups": [
{}
],
"severity": "info_or_unspecified",
"unique_identifier": "37368b5b-c5e7-4670-9902-8a70cca08a56"
},
{
"active_when": {},
"condition": {
"more_than_usual": {
"parameters": {
"group_by": [
"access_mode"
],
"ignore_infinity": true,
"metric_alert_promql_parameters": {
"non_null_percentage": 10,
"promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
"sample_threshold_percentage": 20,
"swap_null_values": false
},
"relative_timeframe": "hour_or_unspecified",
"threshold": 0,
"timeframe": "timeframe_5_min_or_unspecified"
}
}
},
"description": "asd",
"filters": {
"filter_type": "metric",
"metadata": {}
},
"id": "64971da5-a32a-4310-9137-e07ee4d549ab",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 900,
"use_as_notification_settings": true
},
"is_active": false,
"name": "test more than usual 12",
"notification_groups": [
{}
],
"severity": "info_or_unspecified",
"unique_identifier": "c757edc0-ff3a-4dd8-af7a-b06a9feab84d"
},
{
"active_when": {},
"condition": {
"more_than_usual": {
"parameters": {
"group_by": [
"access_mode"
],
"ignore_infinity": true,
"metric_alert_promql_parameters": {
"non_null_percentage": 10,
"promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
"sample_threshold_percentage": 20,
"swap_null_values": false
},
"relative_timeframe": "hour_or_unspecified",
"threshold": 0,
"timeframe": "timeframe_5_min_or_unspecified"
}
}
},
"description": "asd",
"filters": {
"filter_type": "metric",
"metadata": {}
},
"id": "6b6c9073-94c5-4c43-984d-71e29e6025ba",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 900,
"use_as_notification_settings": true
},
"is_active": false,
"name": "test more than usual 12",
"notification_groups": [
{}
],
"severity": "info_or_unspecified",
"unique_identifier": "243ad4d6-ad2e-4c5d-8f12-712d3a089912"
},
{
"active_when": {},
"condition": {
"more_than_usual": {
"parameters": {
"group_by": [
"access_mode"
],
"ignore_infinity": true,
"metric_alert_promql_parameters": {
"non_null_percentage": 10,
"promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
"sample_threshold_percentage": 20,
"swap_null_values": false
},
"relative_timeframe": "hour_or_unspecified",
"threshold": 0,
"timeframe": "timeframe_5_min_or_unspecified"
}
}
},
"description": "asd",
"filters": {
"filter_type": "metric",
"metadata": {}
},
"id": "002822dd-361d-48c6-b5d2-8f4bfcbdf9da",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 900,
"use_as_notification_settings": true
},
"is_active": false,
"name": "test more than usual 12",
"notification_groups": [
{}
],
"severity": "info_or_unspecified",
"unique_identifier": "d0a39163-dc38-4ae4-a62b-af51362c916d"
}
]
}
Alerts.
Possible values: 0 ≤ number of items ≤ 4096
Examples:{ "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ] } ], "severity": "info_or_unspecified", "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4" }
- Alerts
Alert ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Alert name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Unique count alert
Alert description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Example of unique count alert from terraform
Alert is active.
Examples:true
Alert severity.
Possible values: [
info_or_unspecified
,warning
,critical
,error
]Examples:error
Alert expiration date.
- Expiration
Year.
Examples:2012
Month of the year.
Examples:12
Day of the month.
Examples:24
Alert condition.
- Condition
Condition for immediate standard alert.
Alert notification groups.
Possible values: 1 ≤ number of items ≤ 10
- NotificationGroups
Group by fields to group the values by.
Possible values: 0 ≤ number of items ≤ 20, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "cpu" ]
Webhook target settings for the the notification.
Possible values: 0 ≤ number of items ≤ 20
- Notifications
Webhook target settings for the the notification.
- AlertsV2AlertNotification
Retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Possible values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Integration ID.
Possible values: 0 ≤ value ≤ 4294967295
Examples:123
Alert filters.
- Filters
The severity of the logs to filter.
Possible values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
The metadata filters.
- Metadata
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:monitorQuery
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The ratio alerts.
Possible values: 0 ≤ number of items ≤ 4096
- RatioAlerts
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:TopLevelAlert
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The severities to filter.
Possible values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The group by fields.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "Host", "Thread" ]
The type of the filter.
Possible values: [
text_or_unspecified
,template
,ratio
,unique_count
,time_relative
,metric
,flow
]Examples:flow
When should the alert be active.
- ActiveWhen
Activity timeframes of the alert.
Possible values: 1 ≤ number of items ≤ 30
- Timeframes
Days of the week for activity.
Possible values: [
monday_or_unspecified
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
]Possible values: 1 ≤ number of items ≤ 30
Examples:[ "sunday" ]
Time range in the day of the week.
- Range
Start time.
- Start
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
Start time.
- End
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "message", "hostname" ]
The Meta labels to add to the alert.
Possible values: 0 ≤ number of items ≤ 200
- MetaLabels
The key of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:ColorLabel
The value of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Red
The Meta labels to add to the alert as string with ':' separator.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "env:dev" ]
Alert unique identifier.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Incident settings, will create the incident based on this configuration.
- IncidentSettings
The retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Possible values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Use these settings for all notificaion webhook.
Examples:true
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "alerts": [ { "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ] } ], "severity": "info_or_unspecified", "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4" }, { "active_when": { "timeframes": [ { "days_of_week": [ "thursday", "wednesday" ], "range": { "end": { "hours": 18, "minutes": 30 }, "start": { "hours": 6, "minutes": 30 } } } ] }, "condition": { "unique_count": { "parameters": { "cardinality_fields": [ "remote_addr_geoip.country_name" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 2, "timeframe": "timeframe_10_min" } } }, "description": "Example of unique count alert from terraform", "filters": { "filter_type": "unique_count", "metadata": {}, "severities": [ "info" ] }, "id": "5c334366-571a-4431-80ae-3086bf91c575", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 600, "use_as_notification_settings": false }, "is_active": true, "name": "Unique count alert example", "notification_groups": [ { "notifications": [ { "notify_on": "triggered_and_resolved", "recipients": { "emails": [ "example@coralogix.com" ] }, "retriggering_period_seconds": 60 } ] } ], "severity": "warning", "unique_identifier": "e6e01065-7eac-4f5f-8e24-2ee4c7122ab9" }, { "active_when": { "timeframes": [ { "days_of_week": [ "thursday", "wednesday" ], "range": { "end": { "hours": 18, "minutes": 30 }, "start": { "hours": 6, "minutes": 30 } } } ] }, "condition": { "unique_count": { "parameters": { "cardinality_fields": [ "remote_addr_geoip.country_name" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 2, "timeframe": "timeframe_10_min" } } }, "description": "Example of unique count alert from terraform", "filters": { "filter_type": "unique_count", "metadata": {}, "severities": [ "info" ] }, "id": "ffea3734-56eb-4f25-a59a-2d9889c71f46", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 600, "use_as_notification_settings": false }, "is_active": true, "name": "Unique count alert example", "notification_groups": [ { "notifications": [ { "notify_on": "triggered_and_resolved", "recipients": { "emails": [ "example@coralogix.com" ] }, "retriggering_period_seconds": 60 } ] } ], "severity": "info_or_unspecified", "unique_identifier": "39246ad5-19a0-43fd-aa76-e6ff075e864b" }, { "condition": { "more_than_usual": { "parameters": { "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 10, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "OKTA audit extension pack", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "text": "legacyEventType:\\\"login failed\\\"" }, "id": "b2f843d7-4721-4ce2-ac0d-ea0443bbe372", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 60, "use_as_notification_settings": false }, "is_active": true, "name": "More than usual login failures", "notification_groups": [ {} ], "severity": "info_or_unspecified", "show_in_insight": { "notify_on": "triggered_only", "retriggering_period_seconds": 60 }, "unique_identifier": "4fa3710a-c91d-4d6e-8359-41a44c45a141" }, { "condition": { "more_than_usual": { "parameters": { "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 10, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "OKTA audit extension pack", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "text": "legacyEventType:\\\"login failed\\\"" }, "id": "1a02193d-856b-4f84-ab4e-9918ac136244", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 60, "use_as_notification_settings": false }, "is_active": true, "name": "More than usual login failures", "notification_groups": [ {} ], "severity": "info_or_unspecified", "show_in_insight": { "notify_on": "triggered_only", "retriggering_period_seconds": 60 }, "unique_identifier": "bd851dfb-2aa4-4ed7-97ec-922f01f98036" }, { "active_when": { "timeframes": [ { "days_of_week": [ "thursday", "wednesday" ], "range": { "end": { "hours": 18, "minutes": 30 }, "start": { "hours": 6, "minutes": 30 } } } ] }, "condition": { "unique_count": { "parameters": { "cardinality_fields": [ "remote_addr_geoip.country_name" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 2, "timeframe": "timeframe_10_min" } } }, "description": "Example of unique count alert from terraform", "filters": { "filter_type": "unique_count", "metadata": {}, "severities": [ "info" ] }, "id": "29f24d53-f219-4245-a2b9-009e98bd8c4e", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 600, "use_as_notification_settings": false }, "is_active": true, "name": "Unique count alert example", "notification_groups": [ { "notifications": [ { "notify_on": "triggered_and_resolved", "recipients": { "emails": [ "example@coralogix.com" ] }, "retriggering_period_seconds": 60 } ] } ], "severity": "info_or_unspecified", "unique_identifier": "e09735d3-a472-4df7-9d2c-2bfe851c436e" }, { "active_when": { "timeframes": [ { "days_of_week": [ "thursday", "wednesday" ], "range": { "end": { "hours": 18, "minutes": 30 }, "start": { "hours": 6, "minutes": 30 } } } ] }, "condition": { "unique_count": { "parameters": { "cardinality_fields": [ "remote_addr_geoip.country_name" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 2, "timeframe": "timeframe_10_min" } } }, "description": "Example of unique count alert from terraform", "filters": { "filter_type": "unique_count", "metadata": {}, "severities": [ "info" ] }, "id": "3d57bc5b-28b3-4ffe-9ece-049457760edc", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 600, "use_as_notification_settings": false }, "is_active": true, "name": "Unique count alert example", "notification_groups": [ { "notifications": [ { "notify_on": "triggered_and_resolved", "recipients": { "emails": [ "example@coralogix.com" ] }, "retriggering_period_seconds": 60 } ] } ], "severity": "info_or_unspecified", "unique_identifier": "f6f8d470-7793-44d2-82ef-34f95f01b8fa" }, { "active_when": { "timeframes": [ { "days_of_week": [ "monday_or_unspecified", "wednesday" ], "range": { "end": { "hours": 18, "minutes": 30 }, "start": { "hours": 6, "minutes": 30 } } } ] }, "condition": { "unique_count": { "parameters": { "cardinality_fields": [ "remote_addr_geoip.country_name" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 2, "timeframe": "timeframe_10_min" } } }, "description": "Example of unique count alert from terraform", "filters": { "filter_type": "unique_count", "metadata": {}, "severities": [ "info" ] }, "id": "861320bc-33a1-4dfc-9180-0d0afecb68de", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 600, "use_as_notification_settings": false }, "is_active": true, "name": "Unique count alert example", "notification_groups": [ { "notifications": [ { "notify_on": "triggered_and_resolved", "recipients": { "emails": [ "example@coralogix.com" ] }, "retriggering_period_seconds": 60 } ] } ], "severity": "info_or_unspecified", "unique_identifier": "06facfcf-dfdd-49b0-8078-a07448d0cd54" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "060f9814-f7fe-4955-96fd-2c6e790a391b", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 112", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "1ccd73dc-eb4b-437b-b2c1-273457b03424" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "70b27d7d-0c54-4f2f-8254-a9a828571fe9", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "934260b6-cfcd-463a-b25f-54015411df6c" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "4c2132ca-2f2e-4ea5-8089-810ffad38f82", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "f98c3d0e-9ed0-4b0d-a8c4-698ecbfd3c1c" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "ba301f45-c955-4cef-b8b7-fae3d4da26d6", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "258464d8-e26b-4ecb-8b58-07138fe2b44d" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "a32c5827-d31d-4699-8701-c14d905d007b", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "37368b5b-c5e7-4670-9902-8a70cca08a56" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "64971da5-a32a-4310-9137-e07ee4d549ab", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "c757edc0-ff3a-4dd8-af7a-b06a9feab84d" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "6b6c9073-94c5-4c43-984d-71e29e6025ba", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "243ad4d6-ad2e-4c5d-8f12-712d3a089912" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "002822dd-361d-48c6-b5d2-8f4bfcbdf9da", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "d0a39163-dc38-4ae4-a62b-af51362c916d" } ] }
{ "alerts": [ { "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ] } ], "severity": "info_or_unspecified", "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4" }, { "active_when": { "timeframes": [ { "days_of_week": [ "thursday", "wednesday" ], "range": { "end": { "hours": 18, "minutes": 30 }, "start": { "hours": 6, "minutes": 30 } } } ] }, "condition": { "unique_count": { "parameters": { "cardinality_fields": [ "remote_addr_geoip.country_name" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 2, "timeframe": "timeframe_10_min" } } }, "description": "Example of unique count alert from terraform", "filters": { "filter_type": "unique_count", "metadata": {}, "severities": [ "info" ] }, "id": "5c334366-571a-4431-80ae-3086bf91c575", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 600, "use_as_notification_settings": false }, "is_active": true, "name": "Unique count alert example", "notification_groups": [ { "notifications": [ { "notify_on": "triggered_and_resolved", "recipients": { "emails": [ "example@coralogix.com" ] }, "retriggering_period_seconds": 60 } ] } ], "severity": "warning", "unique_identifier": "e6e01065-7eac-4f5f-8e24-2ee4c7122ab9" }, { "active_when": { "timeframes": [ { "days_of_week": [ "thursday", "wednesday" ], "range": { "end": { "hours": 18, "minutes": 30 }, "start": { "hours": 6, "minutes": 30 } } } ] }, "condition": { "unique_count": { "parameters": { "cardinality_fields": [ "remote_addr_geoip.country_name" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 2, "timeframe": "timeframe_10_min" } } }, "description": "Example of unique count alert from terraform", "filters": { "filter_type": "unique_count", "metadata": {}, "severities": [ "info" ] }, "id": "ffea3734-56eb-4f25-a59a-2d9889c71f46", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 600, "use_as_notification_settings": false }, "is_active": true, "name": "Unique count alert example", "notification_groups": [ { "notifications": [ { "notify_on": "triggered_and_resolved", "recipients": { "emails": [ "example@coralogix.com" ] }, "retriggering_period_seconds": 60 } ] } ], "severity": "info_or_unspecified", "unique_identifier": "39246ad5-19a0-43fd-aa76-e6ff075e864b" }, { "condition": { "more_than_usual": { "parameters": { "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 10, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "OKTA audit extension pack", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "text": "legacyEventType:\\\"login failed\\\"" }, "id": "b2f843d7-4721-4ce2-ac0d-ea0443bbe372", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 60, "use_as_notification_settings": false }, "is_active": true, "name": "More than usual login failures", "notification_groups": [ {} ], "severity": "info_or_unspecified", "show_in_insight": { "notify_on": "triggered_only", "retriggering_period_seconds": 60 }, "unique_identifier": "4fa3710a-c91d-4d6e-8359-41a44c45a141" }, { "condition": { "more_than_usual": { "parameters": { "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 10, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "OKTA audit extension pack", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "text": "legacyEventType:\\\"login failed\\\"" }, "id": "1a02193d-856b-4f84-ab4e-9918ac136244", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 60, "use_as_notification_settings": false }, "is_active": true, "name": "More than usual login failures", "notification_groups": [ {} ], "severity": "info_or_unspecified", "show_in_insight": { "notify_on": "triggered_only", "retriggering_period_seconds": 60 }, "unique_identifier": "bd851dfb-2aa4-4ed7-97ec-922f01f98036" }, { "active_when": { "timeframes": [ { "days_of_week": [ "thursday", "wednesday" ], "range": { "end": { "hours": 18, "minutes": 30 }, "start": { "hours": 6, "minutes": 30 } } } ] }, "condition": { "unique_count": { "parameters": { "cardinality_fields": [ "remote_addr_geoip.country_name" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 2, "timeframe": "timeframe_10_min" } } }, "description": "Example of unique count alert from terraform", "filters": { "filter_type": "unique_count", "metadata": {}, "severities": [ "info" ] }, "id": "29f24d53-f219-4245-a2b9-009e98bd8c4e", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 600, "use_as_notification_settings": false }, "is_active": true, "name": "Unique count alert example", "notification_groups": [ { "notifications": [ { "notify_on": "triggered_and_resolved", "recipients": { "emails": [ "example@coralogix.com" ] }, "retriggering_period_seconds": 60 } ] } ], "severity": "info_or_unspecified", "unique_identifier": "e09735d3-a472-4df7-9d2c-2bfe851c436e" }, { "active_when": { "timeframes": [ { "days_of_week": [ "thursday", "wednesday" ], "range": { "end": { "hours": 18, "minutes": 30 }, "start": { "hours": 6, "minutes": 30 } } } ] }, "condition": { "unique_count": { "parameters": { "cardinality_fields": [ "remote_addr_geoip.country_name" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 2, "timeframe": "timeframe_10_min" } } }, "description": "Example of unique count alert from terraform", "filters": { "filter_type": "unique_count", "metadata": {}, "severities": [ "info" ] }, "id": "3d57bc5b-28b3-4ffe-9ece-049457760edc", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 600, "use_as_notification_settings": false }, "is_active": true, "name": "Unique count alert example", "notification_groups": [ { "notifications": [ { "notify_on": "triggered_and_resolved", "recipients": { "emails": [ "example@coralogix.com" ] }, "retriggering_period_seconds": 60 } ] } ], "severity": "info_or_unspecified", "unique_identifier": "f6f8d470-7793-44d2-82ef-34f95f01b8fa" }, { "active_when": { "timeframes": [ { "days_of_week": [ "monday_or_unspecified", "wednesday" ], "range": { "end": { "hours": 18, "minutes": 30 }, "start": { "hours": 6, "minutes": 30 } } } ] }, "condition": { "unique_count": { "parameters": { "cardinality_fields": [ "remote_addr_geoip.country_name" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 2, "timeframe": "timeframe_10_min" } } }, "description": "Example of unique count alert from terraform", "filters": { "filter_type": "unique_count", "metadata": {}, "severities": [ "info" ] }, "id": "861320bc-33a1-4dfc-9180-0d0afecb68de", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 600, "use_as_notification_settings": false }, "is_active": true, "name": "Unique count alert example", "notification_groups": [ { "notifications": [ { "notify_on": "triggered_and_resolved", "recipients": { "emails": [ "example@coralogix.com" ] }, "retriggering_period_seconds": 60 } ] } ], "severity": "info_or_unspecified", "unique_identifier": "06facfcf-dfdd-49b0-8078-a07448d0cd54" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "060f9814-f7fe-4955-96fd-2c6e790a391b", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 112", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "1ccd73dc-eb4b-437b-b2c1-273457b03424" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "70b27d7d-0c54-4f2f-8254-a9a828571fe9", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "934260b6-cfcd-463a-b25f-54015411df6c" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "4c2132ca-2f2e-4ea5-8089-810ffad38f82", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "f98c3d0e-9ed0-4b0d-a8c4-698ecbfd3c1c" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "ba301f45-c955-4cef-b8b7-fae3d4da26d6", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "258464d8-e26b-4ecb-8b58-07138fe2b44d" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "a32c5827-d31d-4699-8701-c14d905d007b", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "37368b5b-c5e7-4670-9902-8a70cca08a56" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "64971da5-a32a-4310-9137-e07ee4d549ab", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "c757edc0-ff3a-4dd8-af7a-b06a9feab84d" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "6b6c9073-94c5-4c43-984d-71e29e6025ba", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "243ad4d6-ad2e-4c5d-8f12-712d3a089912" }, { "active_when": {}, "condition": { "more_than_usual": { "parameters": { "group_by": [ "access_mode" ], "ignore_infinity": true, "metric_alert_promql_parameters": { "non_null_percentage": 10, "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)", "sample_threshold_percentage": 20, "swap_null_values": false }, "relative_timeframe": "hour_or_unspecified", "threshold": 0, "timeframe": "timeframe_5_min_or_unspecified" } } }, "description": "asd", "filters": { "filter_type": "metric", "metadata": {} }, "id": "002822dd-361d-48c6-b5d2-8f4bfcbdf9da", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 900, "use_as_notification_settings": true }, "is_active": false, "name": "test more than usual 12", "notification_groups": [ {} ], "severity": "info_or_unspecified", "unique_identifier": "d0a39163-dc38-4ae4-a62b-af51362c916d" } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Create an alert
Create an alert
Create an alert.
POST /v1/alerts
(logs *LogsV0) CreateAlert(createAlertOptions *CreateAlertOptions) (result *Alert, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateAlertWithContext(ctx context.Context, createAlertOptions *CreateAlertOptions) (result *Alert, response *core.DetailedResponse, err error)
Request
Instantiate the CreateAlertOptions
struct and set the fields to provide parameter values for the CreateAlert
method.
Alert to create/update
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"sunday",
"monday_or_unspecified",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday"
],
"range": {
"end": {
"hours": 18,
"minutes": 29,
"seconds": 59
},
"start": {
"hours": 18,
"minutes": 30,
"seconds": 0
}
}
}
]
},
"condition": {
"more_than": {
"evaluation_window": "rolling_or_unspecified",
"parameters": {
"cardinality_fields": [],
"group_by": [
"coralogix.metadata.applicationName"
],
"ignore_infinity": true,
"notify_group_by_only_alerts": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 1,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Alert if the number of logs reaches a threshold",
"filters": {
"filter_type": "text_or_unspecified",
"metadata": {},
"ratio_alerts": [],
"severities": [
"info"
],
"text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
},
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 300,
"use_as_notification_settings": true
},
"is_active": true,
"meta_labels": [
{
"key": "env",
"value": "dev"
}
],
"meta_labels_strings": [],
"name": "Test alert",
"notification_groups": [
{
"group_by_fields": [
"coralogix.metadata.applicationName"
],
"notifications": []
}
],
"severity": "info_or_unspecified"
}
Alert name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Unique count alert
Alert is active
Example:
true
Alert severity
Allowable values: [
info_or_unspecified
,warning
,critical
,error
]Example:
error
Alert condition
Alert notification groups
Possible values: 1 ≤ number of items ≤ 10
Alert filters
Alert description
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Example of unique count alert from terraform
Alert expiration date
When should the alert be active
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Examples:[ "id", "name" ]
The Meta labels to add to the alert
Possible values: 0 ≤ number of items ≤ 200
The Meta labels to add to the alert as string with ':' separator
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Examples:[ "env:dev" ]
Incident settings, will create the incident based on this configuration
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateAlert options.
Alert name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Test alert
Alert is active.
Examples:true
Alert severity.
Allowable values: [
info_or_unspecified
,warning
,critical
,error
]Examples:info_or_unspecified
Alert condition.
- Condition
Condition for immediate standard alert.
Alert notification groups.
Possible values: 1 ≤ number of items ≤ 10
Examples:[ { "group_by_fields": [ "coralogix.metadata.applicationName" ], "notifications": [] } ]
- NotificationGroups
Group by fields to group the values by.
Possible values: 0 ≤ number of items ≤ 20, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "cpu" ]
Webhook target settings for the the notification.
Possible values: 0 ≤ number of items ≤ 20
- Notifications
Webhook target settings for the the notification.
- AlertsV2AlertNotification
Retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Allowable values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Integration ID.
Possible values: 0 ≤ value ≤ 4294967295
Examples:123
Alert filters.
Examples:{ "filter_type": "text_or_unspecified", "metadata": {}, "ratio_alerts": [], "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }
- Filters
The severity of the logs to filter.
Allowable values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
The metadata filters.
- Metadata
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:monitorQuery
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The ratio alerts.
Possible values: 0 ≤ number of items ≤ 4096
- RatioAlerts
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:TopLevelAlert
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The severities to filter.
Allowable values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The group by fields.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "Host", "Thread" ]
The type of the filter.
Allowable values: [
text_or_unspecified
,template
,ratio
,unique_count
,time_relative
,metric
,flow
]Examples:flow
Alert description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Alert if the number of logs reaches a threshold
Alert expiration date.
- Expiration
Year.
Examples:2012
Month of the year.
Examples:12
Day of the month.
Examples:24
When should the alert be active.
Examples:{ "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30, "seconds": 0 } } } ] }
- ActiveWhen
Activity timeframes of the alert.
Possible values: 1 ≤ number of items ≤ 30
- Timeframes
Days of the week for activity.
Allowable values: [
monday_or_unspecified
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
]Possible values: 1 ≤ number of items ≤ 30
Examples:[ "sunday" ]
Time range in the day of the week.
- Range
Start time.
- Start
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
Start time.
- End
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
The Meta labels to add to the alert.
Possible values: 0 ≤ number of items ≤ 200
Examples:[ { "key": "env", "value": "dev" } ]
- MetaLabels
The key of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:ColorLabel
The value of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Red
The Meta labels to add to the alert as string with ':' separator.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[]
Incident settings, will create the incident based on this configuration.
Examples:{ "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }
- IncidentSettings
The retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Allowable values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Use these settings for all notificaion webhook.
Examples:true
curl -X POST --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30, "seconds": 0 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "cardinality_fields": [], "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "notify_group_by_only_alerts": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "ratio_alerts": [], "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "meta_labels_strings": [], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ], "notifications": [] } ], "severity": "info_or_unspecified" }' "${base_url}/v1/alerts"
alertsV2ConditionParametersModel := &logsv0.AlertsV2ConditionParameters{ Threshold: core.Float64Ptr(float64(1)), Timeframe: core.StringPtr("timeframe_10_min"), GroupBy: []string{"coralogix.metadata.applicationName"}, IgnoreInfinity: core.BoolPtr(true), RelativeTimeframe: core.StringPtr("hour_or_unspecified"), CardinalityFields: []string{}, } alertsV2MoreThanConditionModel := &logsv0.AlertsV2MoreThanCondition{ Parameters: alertsV2ConditionParametersModel, EvaluationWindow: core.StringPtr("rolling_or_unspecified"), } alertsV2AlertConditionModel := &logsv0.AlertsV2AlertConditionConditionMoreThan{ MoreThan: alertsV2MoreThanConditionModel, } alertsV2AlertNotificationModel := &logsv0.AlertsV2AlertNotificationIntegrationTypeIntegrationID{ } alertsV2AlertNotificationGroupsModel := &logsv0.AlertsV2AlertNotificationGroups{ GroupByFields: []string{"coralogix.metadata.applicationName"}, Notifications: []logsv0.AlertsV2AlertNotificationIntf{alertsV2AlertNotificationModel}, } alertsV1AlertFiltersMetadataFiltersModel := &logsv0.AlertsV1AlertFiltersMetadataFilters{ } alertsV1AlertFiltersModel := &logsv0.AlertsV1AlertFilters{ Severities: []string{"info"}, Metadata: alertsV1AlertFiltersMetadataFiltersModel, Text: core.StringPtr("initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"), FilterType: core.StringPtr("text_or_unspecified"), } alertsV1TimeModel := &logsv0.AlertsV1Time{ Hours: core.Int64Ptr(int64(18)), Minutes: core.Int64Ptr(int64(30)), Seconds: core.Int64Ptr(int64(0)), } alertsV1TimeRangeModel := &logsv0.AlertsV1TimeRange{ Start: alertsV1TimeModel, End: alertsV1TimeModel, } alertsV1AlertActiveTimeframeModel := &logsv0.AlertsV1AlertActiveTimeframe{ DaysOfWeek: []string{"sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday"}, Range: alertsV1TimeRangeModel, } alertsV1AlertActiveWhenModel := &logsv0.AlertsV1AlertActiveWhen{ Timeframes: []logsv0.AlertsV1AlertActiveTimeframe{*alertsV1AlertActiveTimeframeModel}, } alertsV1MetaLabelModel := &logsv0.AlertsV1MetaLabel{ Key: core.StringPtr("env"), Value: core.StringPtr("dev"), } alertsV2AlertIncidentSettingsModel := &logsv0.AlertsV2AlertIncidentSettings{ RetriggeringPeriodSeconds: core.Int64Ptr(int64(300)), NotifyOn: core.StringPtr("triggered_only"), UseAsNotificationSettings: core.BoolPtr(true), } createAlertOptions := logsService.NewCreateAlertOptions( "Test alert", true, "info_or_unspecified", alertsV2AlertConditionModel, []logsv0.AlertsV2AlertNotificationGroups{*alertsV2AlertNotificationGroupsModel}, alertsV1AlertFiltersModel, ) createAlertOptions.SetDescription("Alert if the number of logs reaches a threshold") createAlertOptions.SetActiveWhen(alertsV1AlertActiveWhenModel) createAlertOptions.SetMetaLabels([]logsv0.AlertsV1MetaLabel{*alertsV1MetaLabelModel}) createAlertOptions.SetMetaLabelsStrings([]string{}) createAlertOptions.SetIncidentSettings(alertsV2AlertIncidentSettingsModel) alert, response, err := logsService.CreateAlert(createAlertOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(alert, "", " ") fmt.Println(string(b))
Response
Alert resource model
Alert ID
Possible values: length = 36, Value must match regular expression
^[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
Alert name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Unique count alert
Alert is active
Example:
true
Alert severity
Possible values: [
info_or_unspecified
,warning
,critical
,error
]Example:
error
Alert condition
Alert notification groups
Possible values: 1 ≤ number of items ≤ 10
Alert filters
Alert description
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Example of unique count alert from terraform
Alert expiration date
When should the alert be active
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Examples:[ "message", "hostname" ]
The Meta labels to add to the alert
Possible values: 0 ≤ number of items ≤ 200
The Meta labels to add to the alert as string with ':' separator
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Examples:[ "env:dev" ]
Alert unique identifier
Possible values: length = 36, Value must match regular expression
^[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
Incident settings, will create the incident based on this configuration
Alert resource model.
{
"active_when": {
"timeframes": [
{
"days_of_week": [
"sunday",
"monday_or_unspecified",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday"
],
"range": {
"end": {
"hours": 18,
"minutes": 29,
"seconds": 59
},
"start": {
"hours": 18,
"minutes": 30
}
}
}
]
},
"condition": {
"more_than": {
"evaluation_window": "rolling_or_unspecified",
"parameters": {
"group_by": [
"coralogix.metadata.applicationName"
],
"ignore_infinity": true,
"relative_timeframe": "hour_or_unspecified",
"threshold": 1,
"timeframe": "timeframe_10_min"
}
}
},
"description": "Alert if the number of logs reaches a threshold",
"filters": {
"filter_type": "text_or_unspecified",
"metadata": {},
"severities": [
"info"
],
"text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
},
"id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
"incident_settings": {
"notify_on": "triggered_only",
"retriggering_period_seconds": 300,
"use_as_notification_settings": true
},
"is_active": true,
"meta_labels": [
{
"key": "env",
"value": "dev"
}
],
"name": "Test alert",
"notification_groups": [
{
"group_by_fields": [
"coralogix.metadata.applicationName"
]
}
],
"severity": "info_or_unspecified",
"unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
}
Alert ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Alert name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Unique count alert
Alert description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Example of unique count alert from terraform
Alert is active.
Examples:true
Alert severity.
Possible values: [
info_or_unspecified
,warning
,critical
,error
]Examples:error
Alert expiration date.
- Expiration
Year.
Examples:2012
Month of the year.
Examples:12
Day of the month.
Examples:24
Alert condition.
- Condition
Condition for immediate standard alert.
Alert notification groups.
Possible values: 1 ≤ number of items ≤ 10
- NotificationGroups
Group by fields to group the values by.
Possible values: 0 ≤ number of items ≤ 20, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "cpu" ]
Webhook target settings for the the notification.
Possible values: 0 ≤ number of items ≤ 20
- Notifications
Webhook target settings for the the notification.
- AlertsV2AlertNotification
Retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Possible values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Integration ID.
Possible values: 0 ≤ value ≤ 4294967295
Examples:123
Alert filters.
- Filters
The severity of the logs to filter.
Possible values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
The metadata filters.
- Metadata
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:monitorQuery
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The ratio alerts.
Possible values: 0 ≤ number of items ≤ 4096
- RatioAlerts
The alias of the filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:TopLevelAlert
The text to filter.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:_exists_:"container_name"
The severities to filter.
Possible values: [
debug_or_unspecified
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
The applications to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "CpuMonitoring", "WebApi" ]
The subsystems to filter.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "SnapshotGenerator", "PermissionControl" ]
The group by fields.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "Host", "Thread" ]
The type of the filter.
Possible values: [
text_or_unspecified
,template
,ratio
,unique_count
,time_relative
,metric
,flow
]Examples:flow
When should the alert be active.
- ActiveWhen
Activity timeframes of the alert.
Possible values: 1 ≤ number of items ≤ 30
- Timeframes
Days of the week for activity.
Possible values: [
monday_or_unspecified
,tuesday
,wednesday
,thursday
,friday
,saturday
,sunday
]Possible values: 1 ≤ number of items ≤ 30
Examples:[ "sunday" ]
Time range in the day of the week.
- Range
Start time.
- Start
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
Start time.
- End
Hours of the day.
Examples:22
Minutes of the hour.
Examples:22
Seconds of the minute.
Examples:22
JSON keys to include in the alert notification, if left empty get the full log text in the alert notification.
Possible values: 0 ≤ number of items ≤ 100, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "message", "hostname" ]
The Meta labels to add to the alert.
Possible values: 0 ≤ number of items ≤ 200
- MetaLabels
The key of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:ColorLabel
The value of the label.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Red
The Meta labels to add to the alert as string with ':' separator.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 2000, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "env:dev" ]
Alert unique identifier.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Incident settings, will create the incident based on this configuration.
- IncidentSettings
The retriggering period of the alert in seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:60
Notify on setting.
Possible values: [
triggered_only
,triggered_and_resolved
]Examples:triggered_and_resolved
Use these settings for all notificaion webhook.
Examples:true
Status Code
Created
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ] } ], "severity": "info_or_unspecified", "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4" }
{ "active_when": { "timeframes": [ { "days_of_week": [ "sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday" ], "range": { "end": { "hours": 18, "minutes": 29, "seconds": 59 }, "start": { "hours": 18, "minutes": 30 } } } ] }, "condition": { "more_than": { "evaluation_window": "rolling_or_unspecified", "parameters": { "group_by": [ "coralogix.metadata.applicationName" ], "ignore_infinity": true, "relative_timeframe": "hour_or_unspecified", "threshold": 1, "timeframe": "timeframe_10_min" } } }, "description": "Alert if the number of logs reaches a threshold", "filters": { "filter_type": "text_or_unspecified", "metadata": {}, "severities": [ "info" ], "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create" }, "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7", "incident_settings": { "notify_on": "triggered_only", "retriggering_period_seconds": 300, "use_as_notification_settings": true }, "is_active": true, "meta_labels": [ { "key": "env", "value": "dev" } ], "name": "Test alert", "notification_groups": [ { "group_by_fields": [ "coralogix.metadata.applicationName" ] } ], "severity": "info_or_unspecified", "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Gets rule group by groupid
Gets rule group by groupid
Gets rule group by groupid.
GET /v1/rule_groups/{group_id}
(logs *LogsV0) GetRuleGroup(getRuleGroupOptions *GetRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)
(logs *LogsV0) GetRuleGroupWithContext(ctx context.Context, getRuleGroupOptions *GetRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)
Request
Instantiate the GetRuleGroupOptions
struct and set the fields to provide parameter values for the GetRuleGroup
method.
Path Parameters
The group ID
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetRuleGroup options.
The group ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/rule_groups/${group_id}"
getRuleGroupOptions := logsService.NewGetRuleGroupOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), ) ruleGroup, response, err := logsService.GetRuleGroup(getRuleGroupOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(ruleGroup, "", " ") fmt.Println(string(b))
Response
Parsing rule group
The ID of the rule group
Possible values: length = 36, Value must match regular expression
^[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 name of the rule group
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
rule group
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order
Possible values: 1 ≤ number of items ≤ 4096
A description for the rule group, should express what is the rule group purpose
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Rule group to extract severity from logs
Whether or not the rule is enabled
Example:
true
// Optional rule matchers which if matched will make the rule go through the rule group
Possible values: 0 ≤ number of items ≤ 4096
- rule_matchers
// The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order
Possible values: 0 ≤ value ≤ 4294967295
Example:
1
Parsing rule group.
{
"description": "mysql audit logs parser",
"enabled": true,
"hidden": false,
"id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
"name": "mysql-extractrule",
"order": 39,
"rule_matchers": [
{
"subsystem_name": {
"value": "mysql"
}
}
],
"rule_subgroups": [
{
"enabled": true,
"id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
"order": 1,
"rules": [
{
"description": "mysql-parse",
"enabled": true,
"id": "d032de36-1dd2-410d-a992-fc150337df83",
"name": "mysql-parse",
"order": 1,
"parameters": {
"parse_parameters": {
"destination_field": "text",
"rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
}
},
"source_field": "text"
}
]
}
]
}
The ID of the rule group.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
The name of the rule group.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:rule group
A description for the rule group, should express what is the rule group purpose.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule group to extract severity from logs
Whether or not the rule is enabled.
Examples:true
// Optional rule matchers which if matched will make the rule go through the rule group.
Possible values: 0 ≤ number of items ≤ 4096
- RuleMatchers
// Optional rule matchers which if matched will make the rule go through the rule group.
- RulesV1RuleMatcher
ApplicationName constraint.
- ApplicationName
Only logs with this ApplicationName value will match.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:my-application
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order.
Possible values: 1 ≤ number of items ≤ 4096
- RuleSubgroups
The ID of the rule subgroup.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Rules to run on the log.
Possible values: 1 ≤ number of items ≤ 4096
- Rules
Unique identifier of the rule.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Name of the rule.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Extract service and region
Description of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Extracts the service and region from the source field
A field on which value to execute the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:logObj.source
Parameters for a rule which specifies how it should run.
- Parameters
Parameters for text extraction rule.
- ExtractParameters
Regex which will parse the source field and extract the json keys from it while retaining the original log.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^.*$/
Examples:^http:\/\/my\.service\.com\/#(?P<service>\w+)\-(?P<region>[^_]+)_
Whether or not to execute the rule.
Examples:true
The ordering of the rule subgroup. Lower order will run first. 0 is considered as no value.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
Whether or not the rule subgroup is enabled.
Examples:true
The ordering of the rule subgroup. Lower order will run first. 0 is considered as no value.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
// The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "description": "mysql audit logs parser", "enabled": true, "hidden": false, "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d", "name": "mysql-extractrule", "order": 39, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c", "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "id": "d032de36-1dd2-410d-a992-fc150337df83", "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] }
{ "description": "mysql audit logs parser", "enabled": true, "hidden": false, "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d", "name": "mysql-extractrule", "order": 39, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c", "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "id": "d032de36-1dd2-410d-a992-fc150337df83", "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Updates rule group by groupid
Updates rule group by groupid
Updates rule group by groupid.
PUT /v1/rule_groups/{group_id}
(logs *LogsV0) UpdateRuleGroup(updateRuleGroupOptions *UpdateRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdateRuleGroupWithContext(ctx context.Context, updateRuleGroupOptions *UpdateRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateRuleGroupOptions
struct and set the fields to provide parameter values for the UpdateRuleGroup
method.
Path Parameters
The group ID
Possible values: length = 36, Value must match regular expression
^[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
Request model for CreateRuleGroup rpc
{
"description": "mysql audit logs parser",
"enabled": true,
"hidden": false,
"name": "mysql-extractrule",
"order": 39,
"rule_matchers": [
{
"subsystem_name": {
"value": "mysql"
}
}
],
"rule_subgroups": [
{
"enabled": true,
"order": 1,
"rules": [
{
"description": "mysql-parse",
"enabled": true,
"name": "mysql-parse",
"order": 1,
"parameters": {
"parse_parameters": {
"destination_field": "text",
"rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
}
},
"source_field": "text"
}
]
}
]
}
The name of the rule group
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
rule group
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order
Possible values: 1 ≤ number of items ≤ 4096
A description for the rule group, should express what is the rule group purpose
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Rule group to extract severity from logs
Whether or not the rule is enabled
Example:
true
Optional rule matchers which if matched will make the rule go through the rule group
Possible values: 0 ≤ number of items ≤ 4096
- rule_matchers
The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order
Possible values: 0 ≤ value ≤ 4294967295
Example:
1
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The UpdateRuleGroup options.
The group ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
The name of the rule group.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:mysql-extractrule
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order.
Possible values: 1 ≤ number of items ≤ 4096
Examples:[ { "enabled": true, "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ]
- RuleSubgroups
Rules to run on the log.
Possible values: 1 ≤ number of items ≤ 4096
- Rules
Optional rule name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Extract Timestamp
Optional description for the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Extract timestamp with ISO format for Mysql logs
The field on which to execute the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.date_time
Parameters for a rule which specifies how it should run.
- Parameters
Parameters for text extraction rule.
- ExtractParameters
Regex which will parse the source field and extract the json keys from it while retaining the original log.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^.*$/
Examples:^http:\/\/my\.service\.com\/#(?P<service>\w+)\-(?P<region>[^_]+)_
Rule parameters which define how the rule will execute.
Examples:true
The order in which the rule will execute inside the rule subgroup.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
Whether or not the rule subgroup is enabled.
Examples:true
The ordering of the rule subgroup. Lower order will run first. 0 is considered as no value.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
A description for the rule group, should express what is the rule group purpose.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:mysql audit logs parser
Whether or not the rule is enabled.
Examples:true
Optional rule matchers which if matched will make the rule go through the rule group.
Possible values: 0 ≤ number of items ≤ 4096
Examples:[ { "subsystem_name": { "value": "mysql" } } ]
- RuleMatchers
// Optional rule matchers which if matched will make the rule go through the rule group.
- RulesV1RuleMatcher
ApplicationName constraint.
- ApplicationName
Only logs with this ApplicationName value will match.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:my-application
The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order.
Possible values: 0 ≤ value ≤ 4294967295
Examples:39
curl -X PUT --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "description": "mysql audit logs parser", "enabled": true, "hidden": false, "name": "mysql-extractrule", "order": 39, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),?(?P<object>.*)?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] }' "${base_url}/v1/rule_groups/${group_id}"
rulesV1ParseParametersModel := &logsv0.RulesV1ParseParameters{ DestinationField: core.StringPtr("text"), Rule: core.StringPtr("(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"), } rulesV1RuleParametersModel := &logsv0.RulesV1RuleParametersRuleParametersParseParameters{ ParseParameters: rulesV1ParseParametersModel, } rulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRuleModel := &logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRule{ Name: core.StringPtr("mysql-parse"), Description: core.StringPtr("mysql-parse"), SourceField: core.StringPtr("text"), Parameters: rulesV1RuleParametersModel, Enabled: core.BoolPtr(true), Order: core.Int64Ptr(int64(1)), } rulesV1CreateRuleGroupRequestCreateRuleSubgroupModel := &logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroup{ Rules: []logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRule{*rulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRuleModel}, Enabled: core.BoolPtr(true), Order: core.Int64Ptr(int64(1)), } rulesV1SubsystemNameConstraintModel := &logsv0.RulesV1SubsystemNameConstraint{ Value: core.StringPtr("mysql"), } rulesV1RuleMatcherModel := &logsv0.RulesV1RuleMatcherConstraintSubsystemName{ SubsystemName: rulesV1SubsystemNameConstraintModel, } updateRuleGroupOptions := logsService.NewUpdateRuleGroupOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), "mysql-extractrule", []logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroup{*rulesV1CreateRuleGroupRequestCreateRuleSubgroupModel}, ) updateRuleGroupOptions.SetDescription("mysql audit logs parser") updateRuleGroupOptions.SetEnabled(true) updateRuleGroupOptions.SetRuleMatchers([]logsv0.RulesV1RuleMatcherIntf{rulesV1RuleMatcherModel}) updateRuleGroupOptions.SetOrder(int64(39)) ruleGroup, response, err := logsService.UpdateRuleGroup(updateRuleGroupOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(ruleGroup, "", " ") fmt.Println(string(b))
Response
Parsing rule group
The ID of the rule group
Possible values: length = 36, Value must match regular expression
^[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 name of the rule group
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
rule group
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order
Possible values: 1 ≤ number of items ≤ 4096
A description for the rule group, should express what is the rule group purpose
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Rule group to extract severity from logs
Whether or not the rule is enabled
Example:
true
// Optional rule matchers which if matched will make the rule go through the rule group
Possible values: 0 ≤ number of items ≤ 4096
- rule_matchers
// The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order
Possible values: 0 ≤ value ≤ 4294967295
Example:
1
Parsing rule group.
{
"description": "mysql audit logs parser",
"enabled": true,
"hidden": false,
"id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
"name": "mysql-extractrule",
"order": 39,
"rule_matchers": [
{
"subsystem_name": {
"value": "mysql"
}
}
],
"rule_subgroups": [
{
"enabled": true,
"id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
"order": 1,
"rules": [
{
"description": "mysql-parse",
"enabled": true,
"id": "d032de36-1dd2-410d-a992-fc150337df83",
"name": "mysql-parse",
"order": 1,
"parameters": {
"parse_parameters": {
"destination_field": "text",
"rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
}
},
"source_field": "text"
}
]
}
]
}
The ID of the rule group.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
The name of the rule group.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:rule group
A description for the rule group, should express what is the rule group purpose.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule group to extract severity from logs
Whether or not the rule is enabled.
Examples:true
// Optional rule matchers which if matched will make the rule go through the rule group.
Possible values: 0 ≤ number of items ≤ 4096
- RuleMatchers
// Optional rule matchers which if matched will make the rule go through the rule group.
- RulesV1RuleMatcher
ApplicationName constraint.
- ApplicationName
Only logs with this ApplicationName value will match.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:my-application
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order.
Possible values: 1 ≤ number of items ≤ 4096
- RuleSubgroups
The ID of the rule subgroup.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Rules to run on the log.
Possible values: 1 ≤ number of items ≤ 4096
- Rules
Unique identifier of the rule.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Name of the rule.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Extract service and region
Description of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Extracts the service and region from the source field
A field on which value to execute the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:logObj.source
Parameters for a rule which specifies how it should run.
- Parameters
Parameters for text extraction rule.
- ExtractParameters
Regex which will parse the source field and extract the json keys from it while retaining the original log.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^.*$/
Examples:^http:\/\/my\.service\.com\/#(?P<service>\w+)\-(?P<region>[^_]+)_
Whether or not to execute the rule.
Examples:true
The ordering of the rule subgroup. Lower order will run first. 0 is considered as no value.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
Whether or not the rule subgroup is enabled.
Examples:true
The ordering of the rule subgroup. Lower order will run first. 0 is considered as no value.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
// The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "description": "mysql audit logs parser", "enabled": true, "hidden": false, "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d", "name": "mysql-extractrule", "order": 39, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c", "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "id": "d032de36-1dd2-410d-a992-fc150337df83", "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] }
{ "description": "mysql audit logs parser", "enabled": true, "hidden": false, "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d", "name": "mysql-extractrule", "order": 39, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c", "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "id": "d032de36-1dd2-410d-a992-fc150337df83", "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Deletes rule group by groupid
Deletes rule group by groupid
Deletes rule group by groupid.
DELETE /v1/rule_groups/{group_id}
(logs *LogsV0) DeleteRuleGroup(deleteRuleGroupOptions *DeleteRuleGroupOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteRuleGroupWithContext(ctx context.Context, deleteRuleGroupOptions *DeleteRuleGroupOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteRuleGroupOptions
struct and set the fields to provide parameter values for the DeleteRuleGroup
method.
Path Parameters
The group ID
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteRuleGroup options.
The group ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
curl -X DELETE --location --header "Authorization: Bearer ${iam_token}" "${base_url}/v1/rule_groups/${group_id}"
deleteRuleGroupOptions := logsService.NewDeleteRuleGroupOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), ) response, err := logsService.DeleteRuleGroup(deleteRuleGroupOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteRuleGroup(): %d\n", response.StatusCode) }
Response
Status Code
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Gets all rule groups
Gets all rule groups
Gets all rule groups.
GET /v1/rule_groups
(logs *LogsV0) ListRuleGroups(listRuleGroupsOptions *ListRuleGroupsOptions) (result *RuleGroupCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListRuleGroupsWithContext(ctx context.Context, listRuleGroupsOptions *ListRuleGroupsOptions) (result *RuleGroupCollection, response *core.DetailedResponse, err error)
Request
No Request Parameters
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/rule_groups"
listRuleGroupsOptions := logsService.NewListRuleGroupsOptions() ruleGroupCollection, response, err := logsService.ListRuleGroups(listRuleGroupsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(ruleGroupCollection, "", " ") fmt.Println(string(b))
Response
Response model for ListRuleGroups rpc
The rule groups
Possible values: 0 ≤ number of items ≤ 4096
Response model for ListRuleGroups rpc.
{
"rulegroups": [
{
"description": "mysql audit logs parser",
"enabled": true,
"hidden": false,
"id": "a2ddf5dd-f77f-4bea-b782-4068c510e15d",
"name": "mysql-extractrule",
"order": 5,
"rule_matchers": [
{
"subsystem_name": {
"value": "mysql"
}
}
],
"rule_subgroups": [
{
"enabled": true,
"id": "2df585fe-be27-4062-aa42-e740193bfc75",
"order": 1,
"rules": [
{
"description": "mysql-parse",
"enabled": true,
"id": "bd585f17-278a-4908-b05b-54fd6bf693be",
"name": "mysql-parse",
"order": 1,
"parameters": {
"parse_parameters": {
"destination_field": "text",
"rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
}
},
"source_field": "text"
}
]
}
]
}
]
}
The rule groups.
Possible values: 0 ≤ number of items ≤ 4096
Examples:{ "description": "mysql audit logs parser", "enabled": true, "hidden": false, "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d", "name": "mysql-extractrule", "order": 39, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c", "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "id": "d032de36-1dd2-410d-a992-fc150337df83", "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] }
- Rulegroups
The ID of the rule group.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
The name of the rule group.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:rule group
A description for the rule group, should express what is the rule group purpose.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule group to extract severity from logs
Whether or not the rule is enabled.
Examples:true
// Optional rule matchers which if matched will make the rule go through the rule group.
Possible values: 0 ≤ number of items ≤ 4096
- RuleMatchers
// Optional rule matchers which if matched will make the rule go through the rule group.
- RulesV1RuleMatcher
ApplicationName constraint.
- ApplicationName
Only logs with this ApplicationName value will match.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:my-application
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order.
Possible values: 1 ≤ number of items ≤ 4096
- RuleSubgroups
The ID of the rule subgroup.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Rules to run on the log.
Possible values: 1 ≤ number of items ≤ 4096
- Rules
Unique identifier of the rule.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Name of the rule.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Extract service and region
Description of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Extracts the service and region from the source field
A field on which value to execute the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:logObj.source
Parameters for a rule which specifies how it should run.
- Parameters
Parameters for text extraction rule.
- ExtractParameters
Regex which will parse the source field and extract the json keys from it while retaining the original log.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^.*$/
Examples:^http:\/\/my\.service\.com\/#(?P<service>\w+)\-(?P<region>[^_]+)_
Whether or not to execute the rule.
Examples:true
The ordering of the rule subgroup. Lower order will run first. 0 is considered as no value.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
Whether or not the rule subgroup is enabled.
Examples:true
The ordering of the rule subgroup. Lower order will run first. 0 is considered as no value.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
// The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "rulegroups": [ { "description": "mysql audit logs parser", "enabled": true, "hidden": false, "id": "a2ddf5dd-f77f-4bea-b782-4068c510e15d", "name": "mysql-extractrule", "order": 5, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "id": "2df585fe-be27-4062-aa42-e740193bfc75", "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "id": "bd585f17-278a-4908-b05b-54fd6bf693be", "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] } ] }
{ "rulegroups": [ { "description": "mysql audit logs parser", "enabled": true, "hidden": false, "id": "a2ddf5dd-f77f-4bea-b782-4068c510e15d", "name": "mysql-extractrule", "order": 5, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "id": "2df585fe-be27-4062-aa42-e740193bfc75", "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "id": "bd585f17-278a-4908-b05b-54fd6bf693be", "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Creates rule group
Creates rule group
Creates rule group.
POST /v1/rule_groups
(logs *LogsV0) CreateRuleGroup(createRuleGroupOptions *CreateRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateRuleGroupWithContext(ctx context.Context, createRuleGroupOptions *CreateRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)
Request
Instantiate the CreateRuleGroupOptions
struct and set the fields to provide parameter values for the CreateRuleGroup
method.
Request model for CreateRuleGroup rpc
{
"description": "mysql audit logs parser",
"enabled": true,
"hidden": false,
"name": "mysql-extractrule",
"order": 39,
"rule_matchers": [
{
"subsystem_name": {
"value": "mysql"
}
}
],
"rule_subgroups": [
{
"enabled": true,
"order": 1,
"rules": [
{
"description": "mysql-parse",
"enabled": true,
"name": "mysql-parse",
"order": 1,
"parameters": {
"parse_parameters": {
"destination_field": "text",
"rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
}
},
"source_field": "text"
}
]
}
]
}
The name of the rule group
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
rule group
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order
Possible values: 1 ≤ number of items ≤ 4096
A description for the rule group, should express what is the rule group purpose
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Rule group to extract severity from logs
Whether or not the rule is enabled
Example:
true
Optional rule matchers which if matched will make the rule go through the rule group
Possible values: 0 ≤ number of items ≤ 4096
- rule_matchers
The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order
Possible values: 0 ≤ value ≤ 4294967295
Example:
1
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateRuleGroup options.
The name of the rule group.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:mysql-extractrule
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order.
Possible values: 1 ≤ number of items ≤ 4096
Examples:[ { "enabled": true, "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ]
- RuleSubgroups
Rules to run on the log.
Possible values: 1 ≤ number of items ≤ 4096
- Rules
Optional rule name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Extract Timestamp
Optional description for the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Extract timestamp with ISO format for Mysql logs
The field on which to execute the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.date_time
Parameters for a rule which specifies how it should run.
- Parameters
Parameters for text extraction rule.
- ExtractParameters
Regex which will parse the source field and extract the json keys from it while retaining the original log.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^.*$/
Examples:^http:\/\/my\.service\.com\/#(?P<service>\w+)\-(?P<region>[^_]+)_
Rule parameters which define how the rule will execute.
Examples:true
The order in which the rule will execute inside the rule subgroup.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
Whether or not the rule subgroup is enabled.
Examples:true
The ordering of the rule subgroup. Lower order will run first. 0 is considered as no value.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
A description for the rule group, should express what is the rule group purpose.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:mysql audit logs parser
Whether or not the rule is enabled.
Examples:true
Optional rule matchers which if matched will make the rule go through the rule group.
Possible values: 0 ≤ number of items ≤ 4096
Examples:[ { "subsystem_name": { "value": "mysql" } } ]
- RuleMatchers
// Optional rule matchers which if matched will make the rule go through the rule group.
- RulesV1RuleMatcher
ApplicationName constraint.
- ApplicationName
Only logs with this ApplicationName value will match.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:my-application
The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order.
Possible values: 0 ≤ value ≤ 4294967295
Examples:39
curl -X POST --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "description": "mysql audit logs parser", "enabled": true, "hidden": false, "name": "mysql-extractrule", "order": 39, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),?(?P<object>.*)?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] }' "${base_url}/v1/rule_groups"
rulesV1ParseParametersModel := &logsv0.RulesV1ParseParameters{ DestinationField: core.StringPtr("text"), Rule: core.StringPtr("(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"), } rulesV1RuleParametersModel := &logsv0.RulesV1RuleParametersRuleParametersParseParameters{ ParseParameters: rulesV1ParseParametersModel, } rulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRuleModel := &logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRule{ Name: core.StringPtr("mysql-parse"), Description: core.StringPtr("mysql-parse"), SourceField: core.StringPtr("text"), Parameters: rulesV1RuleParametersModel, Enabled: core.BoolPtr(true), Order: core.Int64Ptr(int64(1)), } rulesV1CreateRuleGroupRequestCreateRuleSubgroupModel := &logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroup{ Rules: []logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRule{*rulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRuleModel}, Enabled: core.BoolPtr(true), Order: core.Int64Ptr(int64(1)), } rulesV1SubsystemNameConstraintModel := &logsv0.RulesV1SubsystemNameConstraint{ Value: core.StringPtr("mysql"), } rulesV1RuleMatcherModel := &logsv0.RulesV1RuleMatcherConstraintSubsystemName{ SubsystemName: rulesV1SubsystemNameConstraintModel, } createRuleGroupOptions := logsService.NewCreateRuleGroupOptions( "mysql-extractrule", []logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroup{*rulesV1CreateRuleGroupRequestCreateRuleSubgroupModel}, ) createRuleGroupOptions.SetDescription("mysql audit logs parser") createRuleGroupOptions.SetEnabled(true) createRuleGroupOptions.SetRuleMatchers([]logsv0.RulesV1RuleMatcherIntf{rulesV1RuleMatcherModel}) createRuleGroupOptions.SetOrder(int64(39)) ruleGroup, response, err := logsService.CreateRuleGroup(createRuleGroupOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(ruleGroup, "", " ") fmt.Println(string(b))
Response
Parsing rule group
The ID of the rule group
Possible values: length = 36, Value must match regular expression
^[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 name of the rule group
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
rule group
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order
Possible values: 1 ≤ number of items ≤ 4096
A description for the rule group, should express what is the rule group purpose
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Rule group to extract severity from logs
Whether or not the rule is enabled
Example:
true
// Optional rule matchers which if matched will make the rule go through the rule group
Possible values: 0 ≤ number of items ≤ 4096
- rule_matchers
// The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order
Possible values: 0 ≤ value ≤ 4294967295
Example:
1
Parsing rule group.
{
"description": "mysql audit logs parser",
"enabled": true,
"hidden": false,
"id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
"name": "mysql-extractrule",
"order": 39,
"rule_matchers": [
{
"subsystem_name": {
"value": "mysql"
}
}
],
"rule_subgroups": [
{
"enabled": true,
"id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
"order": 1,
"rules": [
{
"description": "mysql-parse",
"enabled": true,
"id": "d032de36-1dd2-410d-a992-fc150337df83",
"name": "mysql-parse",
"order": 1,
"parameters": {
"parse_parameters": {
"destination_field": "text",
"rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
}
},
"source_field": "text"
}
]
}
]
}
The ID of the rule group.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
The name of the rule group.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:rule group
A description for the rule group, should express what is the rule group purpose.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule group to extract severity from logs
Whether or not the rule is enabled.
Examples:true
// Optional rule matchers which if matched will make the rule go through the rule group.
Possible values: 0 ≤ number of items ≤ 4096
- RuleMatchers
// Optional rule matchers which if matched will make the rule go through the rule group.
- RulesV1RuleMatcher
ApplicationName constraint.
- ApplicationName
Only logs with this ApplicationName value will match.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:my-application
Rule subgroups. Will try to execute the first rule subgroup, and if not matched will try to match the next one in order.
Possible values: 1 ≤ number of items ≤ 4096
- RuleSubgroups
The ID of the rule subgroup.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Rules to run on the log.
Possible values: 1 ≤ number of items ≤ 4096
- Rules
Unique identifier of the rule.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Name of the rule.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Extract service and region
Description of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Extracts the service and region from the source field
A field on which value to execute the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:logObj.source
Parameters for a rule which specifies how it should run.
- Parameters
Parameters for text extraction rule.
- ExtractParameters
Regex which will parse the source field and extract the json keys from it while retaining the original log.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^.*$/
Examples:^http:\/\/my\.service\.com\/#(?P<service>\w+)\-(?P<region>[^_]+)_
Whether or not to execute the rule.
Examples:true
The ordering of the rule subgroup. Lower order will run first. 0 is considered as no value.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
Whether or not the rule subgroup is enabled.
Examples:true
The ordering of the rule subgroup. Lower order will run first. 0 is considered as no value.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
// The order in which the rule group will be evaluated. The lower the order, the more priority the group will have. Not providing the order will by default create a group with the last order.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
Status Code
Created
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "description": "mysql audit logs parser", "enabled": true, "hidden": false, "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d", "name": "mysql-extractrule", "order": 39, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c", "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "id": "d032de36-1dd2-410d-a992-fc150337df83", "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] }
{ "description": "mysql audit logs parser", "enabled": true, "hidden": false, "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d", "name": "mysql-extractrule", "order": 39, "rule_matchers": [ { "subsystem_name": { "value": "mysql" } } ], "rule_subgroups": [ { "enabled": true, "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c", "order": 1, "rules": [ { "description": "mysql-parse", "enabled": true, "id": "d032de36-1dd2-410d-a992-fc150337df83", "name": "mysql-parse", "order": 1, "parameters": { "parse_parameters": { "destination_field": "text", "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)" } }, "source_field": "text" } ] } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
List Outbound Integrations.
List Outbound Integrations.
List Outbound Integrations.
GET /v1/outgoing_webhooks
(logs *LogsV0) ListOutgoingWebhooks(listOutgoingWebhooksOptions *ListOutgoingWebhooksOptions) (result *OutgoingWebhookCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListOutgoingWebhooksWithContext(ctx context.Context, listOutgoingWebhooksOptions *ListOutgoingWebhooksOptions) (result *OutgoingWebhookCollection, response *core.DetailedResponse, err error)
Request
Instantiate the ListOutgoingWebhooksOptions
struct and set the fields to provide parameter values for the ListOutgoingWebhooks
method.
Query Parameters
The type of the deployed Outbound Integrations to list.
Allowable values: [
ibm_event_notifications
]Example:
ibm_event_notifications
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The ListOutgoingWebhooks options.
The type of the deployed Outbound Integrations to list.
Allowable values: [
ibm_event_notifications
]Examples:ibm_event_notifications
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/outgoing_webhooks?type=ibm_event_notifications"
listOutgoingWebhooksOptions := logsService.NewListOutgoingWebhooksOptions() listOutgoingWebhooksOptions.SetType("ibm_event_notifications") outgoingWebhookCollection, response, err := logsService.ListOutgoingWebhooks(listOutgoingWebhooksOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(outgoingWebhookCollection, "", " ") fmt.Println(string(b))
Response
Response for listing Outbound Integrations of a specified type.
The list of deployed Outbound Integrations.
Possible values: 0 ≤ number of items ≤ 4096
Response for listing Outbound Integrations of a specified type.
The list of deployed Outbound Integrations.
Possible values: 0 ≤ number of items ≤ 4096
- OutgoingWebhooks
The ID of the Outbound Integration.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Event Notifications Integration
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:https://example.com
The creation time of the Outbound Integration.
Examples:2021-01-01T00:00:00.000Z
The update time of the Outbound Integration.
Examples:2021-01-01T00:00:00.000Z
The external ID of the Outbound Integration, for connecting with other parts of the system.
Possible values: 0 ≤ value ≤ 4294967295
Examples:123
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Create an Outbound Integration.
Create an Outbound Integration.
Create an Outbound Integration.
POST /v1/outgoing_webhooks
(logs *LogsV0) CreateOutgoingWebhook(createOutgoingWebhookOptions *CreateOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateOutgoingWebhookWithContext(ctx context.Context, createOutgoingWebhookOptions *CreateOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)
Request
Instantiate the CreateOutgoingWebhookOptions
struct and set the fields to provide parameter values for the CreateOutgoingWebhook
method.
The input data of the Outbound Integration.
The type of the deployed Outbound Integrations to list.
Allowable values: [
ibm_event_notifications
]Example:
ibm_event_notifications
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Event Notifications Integration
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
https://example.com
- One of
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateOutgoingWebhook options.
The input data of the Outbound Integration.
- OutgoingWebhookPrototype
The type of the deployed Outbound Integrations to list.
Allowable values: [
ibm_event_notifications
]Examples:ibm_event_notifications
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Event Notifications Integration
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:https://example.com
The configuration of the IBM Event Notifications Outbound Integration.
- IbmEventNotifications
The ID of the selected IBM Event Notifications instance.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
The region ID of the selected IBM Event Notifications instance.
Possible values: 4 ≤ length ≤ 4096, Value must match regular expression
/^[a-z]{2}-[a-z]+$/
Examples:eu-es
The ID of the created source in the IBM Event Notifications instance. Corresponds to the Cloud Logs instance crn. Not required when creating an Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:crn:v1:staging:public:logs:eu-gb:a/223af6f4260f42ebe23e95fcddd33cb7:63a3e4be-cb73-4f52-898e-8e93484a70a5::
The name of the created source in the IBM Event Notifications instance. Not required when creating an Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:IBM Cloud Event Notifications
curl -X POST --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "type": "ibm_event_notifications", "name": "Event Notifications Integration" }' "${base_url}/v1/outgoing_webhooks"
outgoingWebhookPrototypeModel := &logsv0.OutgoingWebhookPrototypeOutgoingWebhooksV1OutgoingWebhookInputDataConfigIbmEventNotifications{ Type: core.StringPtr("ibm_event_notifications"), Name: core.StringPtr("Event Notifications Integration"), } createOutgoingWebhookOptions := logsService.NewCreateOutgoingWebhookOptions( outgoingWebhookPrototypeModel, ) outgoingWebhook, response, err := logsService.CreateOutgoingWebhook(createOutgoingWebhookOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(outgoingWebhook, "", " ") fmt.Println(string(b))
Response
The Outbound Integration
The ID of the Outbound Integration.
Possible values: length = 36, Value must match regular expression
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:
585bea36-bdd1-4bfb-9a26-51f1f8a12660
The type of the deployed Outbound Integrations to list.
Possible values: [
ibm_event_notifications
]Example:
ibm_event_notifications
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Event Notifications Integration
The creation time of the Outbound Integration.
Possible values: 20 ≤ length ≤ 29
Example:
2021-01-01T00:00:00.000Z
The update time of the Outbound Integration.
Possible values: 20 ≤ length ≤ 29
Example:
2021-01-01T00:00:00.000Z
The external ID of the Outbound Integration, for connecting with other parts of the system.
Possible values: 0 ≤ value ≤ 4294967295
Example:
123
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
https://example.com
- One of
The Outbound Integration.
The ID of the Outbound Integration.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
The type of the deployed Outbound Integrations to list.
Possible values: [
ibm_event_notifications
]Examples:ibm_event_notifications
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Event Notifications Integration
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:https://example.com
The creation time of the Outbound Integration.
Examples:2021-01-01T00:00:00.000Z
The update time of the Outbound Integration.
Examples:2021-01-01T00:00:00.000Z
The external ID of the Outbound Integration, for connecting with other parts of the system.
Possible values: 0 ≤ value ≤ 4294967295
Examples:123
The configuration of the IBM Event Notifications Outbound Integration.
- IbmEventNotifications
The ID of the selected IBM Event Notifications instance.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
The region ID of the selected IBM Event Notifications instance.
Possible values: 4 ≤ length ≤ 4096, Value must match regular expression
/^[a-z]{2}-[a-z]+$/
Examples:eu-es
The ID of the created source in the IBM Event Notifications instance. Corresponds to the Cloud Logs instance crn. Not required when creating an Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:crn:v1:staging:public:logs:eu-gb:a/223af6f4260f42ebe23e95fcddd33cb7:63a3e4be-cb73-4f52-898e-8e93484a70a5::
The name of the created source in the IBM Event Notifications instance. Not required when creating an Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:IBM Cloud Event Notifications
Status Code
Created
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Gets an Outbound Integration by ID.
Gets an Outbound Integration by ID.
Gets an Outbound Integration by ID.
GET /v1/outgoing_webhooks/{id}
(logs *LogsV0) GetOutgoingWebhook(getOutgoingWebhookOptions *GetOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) GetOutgoingWebhookWithContext(ctx context.Context, getOutgoingWebhookOptions *GetOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)
Request
Instantiate the GetOutgoingWebhookOptions
struct and set the fields to provide parameter values for the GetOutgoingWebhook
method.
Path Parameters
The ID of the Outbound Integration to delete.
Possible values: length = 36, Value must match regular expression
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:
585bea36-bdd1-4bfb-9a26-51f1f8a12660
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetOutgoingWebhook options.
The ID of the Outbound Integration to delete.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/outgoing_webhooks/${id}"
getOutgoingWebhookOptions := logsService.NewGetOutgoingWebhookOptions( CreateMockUUID("585bea36-bdd1-4bfb-9a26-51f1f8a12660"), ) outgoingWebhook, response, err := logsService.GetOutgoingWebhook(getOutgoingWebhookOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(outgoingWebhook, "", " ") fmt.Println(string(b))
Response
The Outbound Integration
The ID of the Outbound Integration.
Possible values: length = 36, Value must match regular expression
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:
585bea36-bdd1-4bfb-9a26-51f1f8a12660
The type of the deployed Outbound Integrations to list.
Possible values: [
ibm_event_notifications
]Example:
ibm_event_notifications
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Event Notifications Integration
The creation time of the Outbound Integration.
Possible values: 20 ≤ length ≤ 29
Example:
2021-01-01T00:00:00.000Z
The update time of the Outbound Integration.
Possible values: 20 ≤ length ≤ 29
Example:
2021-01-01T00:00:00.000Z
The external ID of the Outbound Integration, for connecting with other parts of the system.
Possible values: 0 ≤ value ≤ 4294967295
Example:
123
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
https://example.com
- One of
The Outbound Integration.
The ID of the Outbound Integration.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
The type of the deployed Outbound Integrations to list.
Possible values: [
ibm_event_notifications
]Examples:ibm_event_notifications
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Event Notifications Integration
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:https://example.com
The creation time of the Outbound Integration.
Examples:2021-01-01T00:00:00.000Z
The update time of the Outbound Integration.
Examples:2021-01-01T00:00:00.000Z
The external ID of the Outbound Integration, for connecting with other parts of the system.
Possible values: 0 ≤ value ≤ 4294967295
Examples:123
The configuration of the IBM Event Notifications Outbound Integration.
- IbmEventNotifications
The ID of the selected IBM Event Notifications instance.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
The region ID of the selected IBM Event Notifications instance.
Possible values: 4 ≤ length ≤ 4096, Value must match regular expression
/^[a-z]{2}-[a-z]+$/
Examples:eu-es
The ID of the created source in the IBM Event Notifications instance. Corresponds to the Cloud Logs instance crn. Not required when creating an Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:crn:v1:staging:public:logs:eu-gb:a/223af6f4260f42ebe23e95fcddd33cb7:63a3e4be-cb73-4f52-898e-8e93484a70a5::
The name of the created source in the IBM Event Notifications instance. Not required when creating an Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:IBM Cloud Event Notifications
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Update an Outbound Integration.
Update an Outbound Integration.
Update an Outbound Integration.
PUT /v1/outgoing_webhooks/{id}
(logs *LogsV0) UpdateOutgoingWebhook(updateOutgoingWebhookOptions *UpdateOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdateOutgoingWebhookWithContext(ctx context.Context, updateOutgoingWebhookOptions *UpdateOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateOutgoingWebhookOptions
struct and set the fields to provide parameter values for the UpdateOutgoingWebhook
method.
Path Parameters
The ID of the Outbound Integration to delete.
Possible values: length = 36, Value must match regular expression
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:
585bea36-bdd1-4bfb-9a26-51f1f8a12660
The input data of the Outbound Integration.
The type of the deployed Outbound Integrations to list.
Allowable values: [
ibm_event_notifications
]Example:
ibm_event_notifications
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Event Notifications Integration
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
https://example.com
- One of
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The UpdateOutgoingWebhook options.
The ID of the Outbound Integration to delete.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
The input data of the Outbound Integration.
- OutgoingWebhookPrototype
The type of the deployed Outbound Integrations to list.
Allowable values: [
ibm_event_notifications
]Examples:ibm_event_notifications
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Event Notifications Integration
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:https://example.com
The configuration of the IBM Event Notifications Outbound Integration.
- IbmEventNotifications
The ID of the selected IBM Event Notifications instance.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
The region ID of the selected IBM Event Notifications instance.
Possible values: 4 ≤ length ≤ 4096, Value must match regular expression
/^[a-z]{2}-[a-z]+$/
Examples:eu-es
The ID of the created source in the IBM Event Notifications instance. Corresponds to the Cloud Logs instance crn. Not required when creating an Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:crn:v1:staging:public:logs:eu-gb:a/223af6f4260f42ebe23e95fcddd33cb7:63a3e4be-cb73-4f52-898e-8e93484a70a5::
The name of the created source in the IBM Event Notifications instance. Not required when creating an Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:IBM Cloud Event Notifications
curl -X PUT --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "type": "ibm_event_notifications", "name": "Event Notifications Integration" }' "${base_url}/v1/outgoing_webhooks/${id}"
outgoingWebhookPrototypeModel := &logsv0.OutgoingWebhookPrototypeOutgoingWebhooksV1OutgoingWebhookInputDataConfigIbmEventNotifications{ Type: core.StringPtr("ibm_event_notifications"), Name: core.StringPtr("Event Notifications Integration"), } updateOutgoingWebhookOptions := logsService.NewUpdateOutgoingWebhookOptions( CreateMockUUID("585bea36-bdd1-4bfb-9a26-51f1f8a12660"), outgoingWebhookPrototypeModel, ) outgoingWebhook, response, err := logsService.UpdateOutgoingWebhook(updateOutgoingWebhookOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(outgoingWebhook, "", " ") fmt.Println(string(b))
Response
The Outbound Integration
The ID of the Outbound Integration.
Possible values: length = 36, Value must match regular expression
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:
585bea36-bdd1-4bfb-9a26-51f1f8a12660
The type of the deployed Outbound Integrations to list.
Possible values: [
ibm_event_notifications
]Example:
ibm_event_notifications
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Event Notifications Integration
The creation time of the Outbound Integration.
Possible values: 20 ≤ length ≤ 29
Example:
2021-01-01T00:00:00.000Z
The update time of the Outbound Integration.
Possible values: 20 ≤ length ≤ 29
Example:
2021-01-01T00:00:00.000Z
The external ID of the Outbound Integration, for connecting with other parts of the system.
Possible values: 0 ≤ value ≤ 4294967295
Example:
123
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
https://example.com
- One of
The Outbound Integration.
The ID of the Outbound Integration.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
The type of the deployed Outbound Integrations to list.
Possible values: [
ibm_event_notifications
]Examples:ibm_event_notifications
The name of the Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Event Notifications Integration
The URL of the Outbound Integration. Null for IBM Event Notifications integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:https://example.com
The creation time of the Outbound Integration.
Examples:2021-01-01T00:00:00.000Z
The update time of the Outbound Integration.
Examples:2021-01-01T00:00:00.000Z
The external ID of the Outbound Integration, for connecting with other parts of the system.
Possible values: 0 ≤ value ≤ 4294967295
Examples:123
The configuration of the IBM Event Notifications Outbound Integration.
- IbmEventNotifications
The ID of the selected IBM Event Notifications instance.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
The region ID of the selected IBM Event Notifications instance.
Possible values: 4 ≤ length ≤ 4096, Value must match regular expression
/^[a-z]{2}-[a-z]+$/
Examples:eu-es
The ID of the created source in the IBM Event Notifications instance. Corresponds to the Cloud Logs instance crn. Not required when creating an Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:crn:v1:staging:public:logs:eu-gb:a/223af6f4260f42ebe23e95fcddd33cb7:63a3e4be-cb73-4f52-898e-8e93484a70a5::
The name of the created source in the IBM Event Notifications instance. Not required when creating an Outbound Integration.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:IBM Cloud Event Notifications
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Delete an Outbound Integration.
Delete an Outbound Integration.
Delete an Outbound Integration.
DELETE /v1/outgoing_webhooks/{id}
(logs *LogsV0) DeleteOutgoingWebhook(deleteOutgoingWebhookOptions *DeleteOutgoingWebhookOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteOutgoingWebhookWithContext(ctx context.Context, deleteOutgoingWebhookOptions *DeleteOutgoingWebhookOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteOutgoingWebhookOptions
struct and set the fields to provide parameter values for the DeleteOutgoingWebhook
method.
Path Parameters
The ID of the Outbound Integration to delete.
Possible values: length = 36, Value must match regular expression
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:
585bea36-bdd1-4bfb-9a26-51f1f8a12660
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteOutgoingWebhook options.
The ID of the Outbound Integration to delete.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:585bea36-bdd1-4bfb-9a26-51f1f8a12660
curl -X DELETE --location --header "Authorization: Bearer ${iam_token}" "${base_url}/v1/outgoing_webhooks/${id}"
deleteOutgoingWebhookOptions := logsService.NewDeleteOutgoingWebhookOptions( CreateMockUUID("585bea36-bdd1-4bfb-9a26-51f1f8a12660"), ) response, err := logsService.DeleteOutgoingWebhook(deleteOutgoingWebhookOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteOutgoingWebhook(): %d\n", response.StatusCode) }
Response
Status Code
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Gets policy by id
Gets policy by id
Gets policy by id.
GET /v1/policies/{id}
(logs *LogsV0) GetPolicy(getPolicyOptions *GetPolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) GetPolicyWithContext(ctx context.Context, getPolicyOptions *GetPolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)
Request
Instantiate the GetPolicyOptions
struct and set the fields to provide parameter values for the GetPolicy
method.
Path Parameters
ID of policy
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetPolicy options.
ID of policy.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/policies/${id}"
getPolicyOptions := logsService.NewGetPolicyOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), ) policy, response, err := logsService.GetPolicy(getPolicyOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(policy, "", " ") fmt.Println(string(b))
Response
Policy resource model
Policy ID
Possible values: length = 36, Value must match regular expression
^[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
Company ID
Example:
1234
Name of policy
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Policy Name
Description of policy
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Policy Description
Order of policy in relation to other policies
Example:
1
Created at date at utc+0
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}"$
Example:
2023-06-21T14:24:39.000Z
Updated at date at utc+0
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}"$
Example:
2023-06-21T14:24:39.000Z
The data pipeline sources that match the policy rules will go through
Possible values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Example:
type_high
Soft deletion flag
Example:
true
Enabled flag
Example:
true
Rule for matching with application
Rule for matching with application
Archive retention definition
- One of
Policy resource model.
Policy ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Company ID.
Examples:1234
Name of policy.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Policy Name
Description of policy.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Policy Description
The data pipeline sources that match the policy rules will go through.
Possible values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Examples:type_high
Soft deletion flag.
Examples:true
Enabled flag.
Examples:true
Order of policy in relation to other policies.
Examples:1
Rule for matching with application.
- ApplicationRule
Identifier of the rule.
Possible values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Rule for matching with application.
- SubsystemRule
Identifier of the rule.
Possible values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Created at date at utc+0.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^\"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\"$/
Examples:2023-06-21 14:24:39
Updated at date at utc+0.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^\"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\"$/
Examples:2023-06-21 14:24:39
Archive retention definition.
- ArchiveRetention
References archive retention definition.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Log rules.
- LogRules
Source severities to match with.
Possible values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "company_id": 192, "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)", "deleted": false, "description": "Medium policy", "enabled": true, "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc", "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" }, "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)" }
{ "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "company_id": 192, "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)", "deleted": false, "description": "Medium policy", "enabled": true, "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc", "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" }, "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Updates an existing policy
Updates an existing policy
Updates an existing policy.
PUT /v1/policies/{id}
(logs *LogsV0) UpdatePolicy(updatePolicyOptions *UpdatePolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdatePolicyWithContext(ctx context.Context, updatePolicyOptions *UpdatePolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)
Request
Instantiate the UpdatePolicyOptions
struct and set the fields to provide parameter values for the UpdatePolicy
method.
Path Parameters
ID of policy
Possible values: length = 36, Value must match regular expression
^[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
Create policy request
{
"application_rule": {
"name": "policy-test",
"rule_type_id": "is"
},
"deleted": false,
"description": "Medium policy",
"enabled": true,
"log_rules": {
"severities": [
"debug",
"verbose",
"info",
"warning",
"error"
]
},
"name": "Med_policy",
"order": 2,
"priority": "type_high",
"subsystem_rule": {
"name": "policy-test",
"rule_type_id": "is"
}
}
Policy name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
My Policy
The data pipeline sources that match the policy rules will go through
Allowable values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Example:
type_high
Policy description
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
My Policy Description
Rule for matching with application
Rule for matching with application
Archive retention definition
- One of
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The UpdatePolicy options.
ID of policy.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Create policy request.
- PolicyPrototype
Policy name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:My Policy
Policy description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:My Policy Description
The data pipeline sources that match the policy rules will go through.
Allowable values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Examples:type_high
Rule for matching with application.
- ApplicationRule
Identifier of the rule.
Allowable values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Rule for matching with application.
- SubsystemRule
Identifier of the rule.
Allowable values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Archive retention definition.
- ArchiveRetention
References archive retention definition.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Log rules.
- LogRules
Source severities to match with.
Allowable values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
curl -X PUT --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "deleted": false, "description": "Medium policy", "enabled": true, "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" } }' "${base_url}/v1/policies/${id}"
quotaV1RuleModel := &logsv0.QuotaV1Rule{ RuleTypeID: core.StringPtr("is"), Name: core.StringPtr("policy-test"), } quotaV1LogRulesModel := &logsv0.QuotaV1LogRules{ Severities: []string{"debug", "verbose", "info", "warning", "error"}, } policyPrototypeModel := &logsv0.PolicyPrototypeQuotaV1CreatePolicyRequestSourceTypeRulesLogRules{ Name: core.StringPtr("Med_policy"), Description: core.StringPtr("Medium policy"), Priority: core.StringPtr("type_high"), ApplicationRule: quotaV1RuleModel, SubsystemRule: quotaV1RuleModel, LogRules: quotaV1LogRulesModel, } updatePolicyOptions := logsService.NewUpdatePolicyOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), policyPrototypeModel, ) policy, response, err := logsService.UpdatePolicy(updatePolicyOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(policy, "", " ") fmt.Println(string(b))
Response
Policy resource model
Policy ID
Possible values: length = 36, Value must match regular expression
^[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
Company ID
Example:
1234
Name of policy
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Policy Name
Description of policy
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Policy Description
Order of policy in relation to other policies
Example:
1
Created at date at utc+0
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}"$
Example:
2023-06-21T14:24:39.000Z
Updated at date at utc+0
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}"$
Example:
2023-06-21T14:24:39.000Z
The data pipeline sources that match the policy rules will go through
Possible values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Example:
type_high
Soft deletion flag
Example:
true
Enabled flag
Example:
true
Rule for matching with application
Rule for matching with application
Archive retention definition
- One of
Policy resource model.
Policy ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Company ID.
Examples:1234
Name of policy.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Policy Name
Description of policy.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Policy Description
The data pipeline sources that match the policy rules will go through.
Possible values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Examples:type_high
Soft deletion flag.
Examples:true
Enabled flag.
Examples:true
Order of policy in relation to other policies.
Examples:1
Rule for matching with application.
- ApplicationRule
Identifier of the rule.
Possible values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Rule for matching with application.
- SubsystemRule
Identifier of the rule.
Possible values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Created at date at utc+0.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^\"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\"$/
Examples:2023-06-21 14:24:39
Updated at date at utc+0.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^\"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\"$/
Examples:2023-06-21 14:24:39
Archive retention definition.
- ArchiveRetention
References archive retention definition.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Log rules.
- LogRules
Source severities to match with.
Possible values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "company_id": 192, "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)", "deleted": false, "description": "Medium policy", "enabled": true, "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc", "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" }, "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)" }
{ "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "company_id": 192, "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)", "deleted": false, "description": "Medium policy", "enabled": true, "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc", "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" }, "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Deletes an existing policy
Deletes an existing policy
Deletes an existing policy.
DELETE /v1/policies/{id}
(logs *LogsV0) DeletePolicy(deletePolicyOptions *DeletePolicyOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeletePolicyWithContext(ctx context.Context, deletePolicyOptions *DeletePolicyOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeletePolicyOptions
struct and set the fields to provide parameter values for the DeletePolicy
method.
Path Parameters
ID of policy
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeletePolicy options.
ID of policy.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
curl -X DELETE --location --header "Authorization: Bearer ${iam_token}" "${base_url}/v1/policies/${id}"
deletePolicyOptions := logsService.NewDeletePolicyOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), ) response, err := logsService.DeletePolicy(deletePolicyOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeletePolicy(): %d\n", response.StatusCode) }
Response
Status Code
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Gets policies
Gets policies
Gets policies.
GET /v1/policies
(logs *LogsV0) GetCompanyPolicies(getCompanyPoliciesOptions *GetCompanyPoliciesOptions) (result *PolicyCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) GetCompanyPoliciesWithContext(ctx context.Context, getCompanyPoliciesOptions *GetCompanyPoliciesOptions) (result *PolicyCollection, response *core.DetailedResponse, err error)
Request
Instantiate the GetCompanyPoliciesOptions
struct and set the fields to provide parameter values for the GetCompanyPolicies
method.
Query Parameters
Optionally filter only enabled policies
Example:
true
Source type to filter policies by
Allowable values: [
unspecified
,logs
]Example:
logs
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetCompanyPolicies options.
Optionally filter only enabled policies.
Examples:true
Source type to filter policies by.
Allowable values: [
unspecified
,logs
]Examples:logs
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/policies?enabled_only=true&source_type=logs"
getCompanyPoliciesOptions := logsService.NewGetCompanyPoliciesOptions() getCompanyPoliciesOptions.SetEnabledOnly(true) getCompanyPoliciesOptions.SetSourceType("logs") policyCollection, response, err := logsService.GetCompanyPolicies(getCompanyPoliciesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(policyCollection, "", " ") fmt.Println(string(b))
Response
Response to get company policies request
Company policies
Possible values: 0 ≤ number of items ≤ 4096
- policies
Response to get company policies request.
{
"policies": [
{
"application_rule": {
"name": "policy-test",
"rule_type_id": "is"
},
"company_id": 192,
"created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)",
"deleted": false,
"description": "Medium policy",
"enabled": true,
"id": "ac91d47c-faf1-4761-831d-b393f81a3fdc",
"log_rules": {
"severities": [
"debug",
"verbose",
"info",
"warning",
"error"
]
},
"name": "Med_policy",
"order": 2,
"priority": "type_high",
"subsystem_rule": {
"name": "policy-test",
"rule_type_id": "is"
},
"updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)"
}
]
}
Company policies.
Possible values: 0 ≤ number of items ≤ 4096
Examples:{ "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "company_id": 192, "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)", "deleted": false, "description": "Medium policy", "enabled": true, "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc", "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" }, "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)" }
- Policies
Policy resource model.
- Policy
Policy ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Company ID.
Examples:1234
Name of policy.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Policy Name
Description of policy.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Policy Description
The data pipeline sources that match the policy rules will go through.
Possible values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Examples:type_high
Soft deletion flag.
Examples:true
Enabled flag.
Examples:true
Order of policy in relation to other policies.
Examples:1
Rule for matching with application.
- ApplicationRule
Identifier of the rule.
Possible values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Rule for matching with application.
- SubsystemRule
Identifier of the rule.
Possible values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Created at date at utc+0.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^\"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\"$/
Examples:2023-06-21 14:24:39
Updated at date at utc+0.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^\"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\"$/
Examples:2023-06-21 14:24:39
Archive retention definition.
- ArchiveRetention
References archive retention definition.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Log rules.
- LogRules
Source severities to match with.
Possible values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "policies": [ { "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "company_id": 192, "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)", "deleted": false, "description": "Medium policy", "enabled": true, "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc", "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" }, "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)" } ] }
{ "policies": [ { "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "company_id": 192, "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)", "deleted": false, "description": "Medium policy", "enabled": true, "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc", "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" }, "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)" } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Creates a new policy
Creates a new policy
Creates a new policy.
POST /v1/policies
(logs *LogsV0) CreatePolicy(createPolicyOptions *CreatePolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) CreatePolicyWithContext(ctx context.Context, createPolicyOptions *CreatePolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)
Request
Instantiate the CreatePolicyOptions
struct and set the fields to provide parameter values for the CreatePolicy
method.
Create policy request
{
"application_rule": {
"name": "policy-test",
"rule_type_id": "is"
},
"deleted": false,
"description": "Medium Policy",
"enabled": true,
"log_rules": {
"severities": [
"debug",
"verbose",
"info",
"warning",
"error"
]
},
"name": "Med_policy",
"order": 2,
"priority": "type_high",
"subsystem_rule": {
"name": "policy-test",
"rule_type_id": "is"
}
}
Policy name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
My Policy
The data pipeline sources that match the policy rules will go through
Allowable values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Example:
type_high
Policy description
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
My Policy Description
Rule for matching with application
Rule for matching with application
Archive retention definition
- One of
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreatePolicy options.
Create policy request.
- PolicyPrototype
Policy name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:My Policy
Policy description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:My Policy Description
The data pipeline sources that match the policy rules will go through.
Allowable values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Examples:type_high
Rule for matching with application.
- ApplicationRule
Identifier of the rule.
Allowable values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Rule for matching with application.
- SubsystemRule
Identifier of the rule.
Allowable values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Archive retention definition.
- ArchiveRetention
References archive retention definition.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Log rules.
- LogRules
Source severities to match with.
Allowable values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
curl -X POST --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "deleted": false, "description": "Medium Policy", "enabled": true, "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" } }' "${base_url}/v1/policies"
quotaV1RuleModel := &logsv0.QuotaV1Rule{ RuleTypeID: core.StringPtr("is"), Name: core.StringPtr("policy-test"), } quotaV1LogRulesModel := &logsv0.QuotaV1LogRules{ Severities: []string{"debug", "verbose", "info", "warning", "error"}, } policyPrototypeModel := &logsv0.PolicyPrototypeQuotaV1CreatePolicyRequestSourceTypeRulesLogRules{ Name: core.StringPtr("Med_policy"), Description: core.StringPtr("Medium Policy"), Priority: core.StringPtr("type_high"), ApplicationRule: quotaV1RuleModel, SubsystemRule: quotaV1RuleModel, LogRules: quotaV1LogRulesModel, } createPolicyOptions := logsService.NewCreatePolicyOptions( policyPrototypeModel, ) policy, response, err := logsService.CreatePolicy(createPolicyOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(policy, "", " ") fmt.Println(string(b))
Response
Policy resource model
Policy ID
Possible values: length = 36, Value must match regular expression
^[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
Company ID
Example:
1234
Name of policy
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Policy Name
Description of policy
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Policy Description
Order of policy in relation to other policies
Example:
1
Created at date at utc+0
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}"$
Example:
2023-06-21T14:24:39.000Z
Updated at date at utc+0
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}"$
Example:
2023-06-21T14:24:39.000Z
The data pipeline sources that match the policy rules will go through
Possible values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Example:
type_high
Soft deletion flag
Example:
true
Enabled flag
Example:
true
Rule for matching with application
Rule for matching with application
Archive retention definition
- One of
Policy resource model.
Policy ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Company ID.
Examples:1234
Name of policy.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Policy Name
Description of policy.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Policy Description
The data pipeline sources that match the policy rules will go through.
Possible values: [
type_unspecified
,type_block
,type_low
,type_medium
,type_high
]Examples:type_high
Soft deletion flag.
Examples:true
Enabled flag.
Examples:true
Order of policy in relation to other policies.
Examples:1
Rule for matching with application.
- ApplicationRule
Identifier of the rule.
Possible values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Rule for matching with application.
- SubsystemRule
Identifier of the rule.
Possible values: [
unspecified
,is
,is_not
,start_with
,includes
]Examples:includes
Value of the rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Rule Name
Created at date at utc+0.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^\"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\"$/
Examples:2023-06-21 14:24:39
Updated at date at utc+0.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^\"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\"$/
Examples:2023-06-21 14:24:39
Archive retention definition.
- ArchiveRetention
References archive retention definition.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Log rules.
- LogRules
Source severities to match with.
Possible values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
Status Code
Created
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "company_id": 192, "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)", "deleted": false, "description": "Medium policy", "enabled": true, "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc", "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" }, "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)" }
{ "application_rule": { "name": "policy-test", "rule_type_id": "is" }, "company_id": 192, "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)", "deleted": false, "description": "Medium policy", "enabled": true, "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc", "log_rules": { "severities": [ "debug", "verbose", "info", "warning", "error" ] }, "name": "Med_policy", "order": 2, "priority": "type_high", "subsystem_rule": { "name": "policy-test", "rule_type_id": "is" }, "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Lists event to metrics definitions
Lists event to metrics definitions
Lists event to metrics definitions.
GET /v1/events2metrics
(logs *LogsV0) ListE2m(listE2mOptions *ListE2mOptions) (result *Event2MetricCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListE2mWithContext(ctx context.Context, listE2mOptions *ListE2mOptions) (result *Event2MetricCollection, response *core.DetailedResponse, err error)
Request
No Request Parameters
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/events2metrics"
listE2mOptions := logsService.NewListE2mOptions() event2MetricCollection, response, err := logsService.ListE2m(listE2mOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(event2MetricCollection, "", " ") fmt.Println(string(b))
Response
Represents response of
List of event to metrics definitions
Possible values: 0 ≤ number of items ≤ 4096
- events2metrics
Represents response of.
{
"events2metrics": [
{
"create_time": "2024-03-11T10:38:21.000Z",
"description": "Test e2m updated",
"id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de",
"is_internal": true,
"logs_query": {
"lucene": "logs"
},
"name": "test em2",
"permutations": {
"limit": 1
},
"type": "logs2metrics",
"update_time": "2024-03-11T10:38:21.000Z"
}
]
}
List of event to metrics definitions.
Possible values: 0 ≤ number of items ≤ 4096
Examples:{ "create_time": "2024-03-11T10:38:21.000Z", "description": "Test e2m updated", "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de", "is_internal": true, "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations": { "limit": 1 }, "type": "logs2metrics", "update_time": "2024-03-11T10:38:21.000Z" }
- Events2metrics
E2M represents the Event to metrics base model.
- Event2Metric
E2M unique ID, required on update requests.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:d6a3658e-78d2-47d0-9b81-b2c551f01b09
Name of the E2M.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Service_catalog_latency
Description of the E2M.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:avg and max the latency of catalog service
E2M create time.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:2022-06-30T12:30:00Z'
E2M update time.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:2022-06-30T12:30:00Z'
Represents the limit of the permutations and if the limit was exceeded.
- Permutations
E2M permutation limit.
Examples:30000
Flag to indicate if limit was exceeded.
Examples:true
E2M metric labels.
Possible values: 0 ≤ number of items ≤ 4096
- MetricLabels
Metric label target alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_label_name
Metric label source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.string_value
E2M metric fields.
Possible values: 0 ≤ number of items ≤ 10
- MetricFields
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_field_name
Source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field
Represents Aggregation type list.
Possible values: 0 ≤ number of items ≤ 4096
- Aggregations
Represents Aggregation type list.
- ApisEvents2metricsV2Aggregation
Is enabled.
Examples:true
Aggregation type.
Possible values: [
unspecified
,min
,max
,count
,avg
,sum
,histogram
,samples
]Examples:samples
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:alias_field_name_agg_func
E2M sample type metadata.
- Samples
Sample type min/max.
Possible values: [
unspecified
,min
,max
]Examples:max
E2M type.
Possible values: [
unspecified
,logs2metrics
]Examples:logs2metrics
A flag that represents if the e2m is for internal usage.
Examples:true
E2M logs query.
- LogsQuery
Lucene query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field: [50 TO 100]
Alias.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:new_query
Application name filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "app_name" ]
Subsystem names filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "sub_name" ]
Severity type filters.
Possible values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "events2metrics": [ { "create_time": "2024-03-11T10:38:21.000Z", "description": "Test e2m updated", "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de", "is_internal": true, "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations": { "limit": 1 }, "type": "logs2metrics", "update_time": "2024-03-11T10:38:21.000Z" } ] }
{ "events2metrics": [ { "create_time": "2024-03-11T10:38:21.000Z", "description": "Test e2m updated", "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de", "is_internal": true, "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations": { "limit": 1 }, "type": "logs2metrics", "update_time": "2024-03-11T10:38:21.000Z" } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Creates event to metrics definitions
Creates event to metrics definitions
Creates event to metrics definitions.
POST /v1/events2metrics
(logs *LogsV0) CreateE2m(createE2mOptions *CreateE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateE2mWithContext(ctx context.Context, createE2mOptions *CreateE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)
Request
Instantiate the CreateE2mOptions
struct and set the fields to provide parameter values for the CreateE2m
method.
E2M Create message
{
"description": "Test e2m",
"logs_query": {
"lucene": "logs"
},
"name": "test em2",
"permutations_limit": 1,
"type": "logs2metrics"
}
Name of E2M to create
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Service catalog latency
Description of E2M to create
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
avg and max the latency of catalog service
The permutation limit of the E2M
Example:
30000
E2M metric labels
Possible values: 0 ≤ number of items ≤ 4096
E2M metric fields
Possible values: 0 ≤ number of items ≤ 4096
E2M type
Allowable values: [
unspecified
,logs2metrics
]Example:
logs2metrics
- One of
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateE2m options.
E2M Create message.
- Event2MetricPrototype
Name of E2M to create.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Service catalog latency
Description of E2M to create.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:avg and max the latency of catalog service
The permutation limit of the E2M.
Examples:30000
E2M metric labels.
Possible values: 0 ≤ number of items ≤ 4096
- MetricLabels
Metric label target alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_label_name
Metric label source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.string_value
E2M metric fields.
Possible values: 0 ≤ number of items ≤ 4096
- MetricFields
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_field_name
Source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field
Represents Aggregation type list.
Possible values: 0 ≤ number of items ≤ 4096
- Aggregations
Represents Aggregation type list.
- ApisEvents2metricsV2Aggregation
Is enabled.
Examples:true
Aggregation type.
Allowable values: [
unspecified
,min
,max
,count
,avg
,sum
,histogram
,samples
]Examples:samples
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:alias_field_name_agg_func
E2M sample type metadata.
- Samples
Sample type min/max.
Allowable values: [
unspecified
,min
,max
]Examples:max
E2M type.
Allowable values: [
unspecified
,logs2metrics
]Examples:logs2metrics
E2M logs query.
- LogsQuery
Lucene query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field: [50 TO 100]
Alias.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:new_query
Application name filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "app_name" ]
Subsystem names filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "sub_name" ]
Severity type filters.
Allowable values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
curl -X POST --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "description": "Test e2m", "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations_limit": 1, "type": "logs2metrics" }' "${base_url}/v1/events2metrics"
apisLogs2metricsV2LogsQueryModel := &logsv0.ApisLogs2metricsV2LogsQuery{ Lucene: core.StringPtr("logs"), } event2MetricPrototypeModel := &logsv0.Event2MetricPrototypeApisEvents2metricsV2E2mCreateParamsQueryLogsQuery{ Name: core.StringPtr("test em2"), Description: core.StringPtr("Test e2m"), PermutationsLimit: core.Int64Ptr(int64(1)), Type: core.StringPtr("logs2metrics"), LogsQuery: apisLogs2metricsV2LogsQueryModel, } createE2mOptions := logsService.NewCreateE2mOptions( event2MetricPrototypeModel, ) event2Metric, response, err := logsService.CreateE2m(createE2mOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(event2Metric, "", " ") fmt.Println(string(b))
Response
E2M represents the Event to metrics base model.
Name of the E2M
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Service_catalog_latency
E2M type
Possible values: [
unspecified
,logs2metrics
]Example:
logs2metrics
E2M unique ID, required on update requests
Possible values: length = 36, Value must match regular expression
^[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
Description of the E2M
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
avg and max the latency of catalog service
E2M create time
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
2022-06-30T12:30:00Z'
E2M update time
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
2022-06-30T12:30:00Z'
Represents the limit of the permutations and if the limit was exceeded
E2M metric labels
Possible values: 0 ≤ number of items ≤ 4096
E2M metric fields
Possible values: 0 ≤ number of items ≤ 10
A flag that represents if the e2m is for internal usage
Example:
true
- One of
E2M represents the Event to metrics base model.
E2M unique ID, required on update requests.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:d6a3658e-78d2-47d0-9b81-b2c551f01b09
Name of the E2M.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Service_catalog_latency
Description of the E2M.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:avg and max the latency of catalog service
E2M create time.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:2022-06-30T12:30:00Z'
E2M update time.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:2022-06-30T12:30:00Z'
Represents the limit of the permutations and if the limit was exceeded.
- Permutations
E2M permutation limit.
Examples:30000
Flag to indicate if limit was exceeded.
Examples:true
E2M metric labels.
Possible values: 0 ≤ number of items ≤ 4096
- MetricLabels
Metric label target alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_label_name
Metric label source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.string_value
E2M metric fields.
Possible values: 0 ≤ number of items ≤ 10
- MetricFields
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_field_name
Source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field
Represents Aggregation type list.
Possible values: 0 ≤ number of items ≤ 4096
- Aggregations
Represents Aggregation type list.
- ApisEvents2metricsV2Aggregation
Is enabled.
Examples:true
Aggregation type.
Possible values: [
unspecified
,min
,max
,count
,avg
,sum
,histogram
,samples
]Examples:samples
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:alias_field_name_agg_func
E2M sample type metadata.
- Samples
Sample type min/max.
Possible values: [
unspecified
,min
,max
]Examples:max
E2M type.
Possible values: [
unspecified
,logs2metrics
]Examples:logs2metrics
A flag that represents if the e2m is for internal usage.
Examples:true
E2M logs query.
- LogsQuery
Lucene query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field: [50 TO 100]
Alias.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:new_query
Application name filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "app_name" ]
Subsystem names filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "sub_name" ]
Severity type filters.
Possible values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
Status Code
Created
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "create_time": "2024-03-11T10:38:21.000Z", "description": "Test e2m updated", "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de", "is_internal": true, "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations": { "limit": 1 }, "type": "logs2metrics", "update_time": "2024-03-11T10:38:21.000Z" }
{ "create_time": "2024-03-11T10:38:21.000Z", "description": "Test e2m updated", "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de", "is_internal": true, "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations": { "limit": 1 }, "type": "logs2metrics", "update_time": "2024-03-11T10:38:21.000Z" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Gets event to metrics definitions by id
Gets event to metrics definitions by id
Gets event to metrics definitions by id.
GET /v1/events2metrics/{id}
(logs *LogsV0) GetE2m(getE2mOptions *GetE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) GetE2mWithContext(ctx context.Context, getE2mOptions *GetE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)
Request
Instantiate the GetE2mOptions
struct and set the fields to provide parameter values for the GetE2m
method.
Path Parameters
ID of e2m to be deleted
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
d6a3658e-78d2-47d0-9b81-b2c551f01b09
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetE2m options.
ID of e2m to be deleted.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:d6a3658e-78d2-47d0-9b81-b2c551f01b09
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/events2metrics/${id}"
getE2mOptions := logsService.NewGetE2mOptions( "d6a3658e-78d2-47d0-9b81-b2c551f01b09", ) event2Metric, response, err := logsService.GetE2m(getE2mOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(event2Metric, "", " ") fmt.Println(string(b))
Response
E2M represents the Event to metrics base model.
Name of the E2M
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Service_catalog_latency
E2M type
Possible values: [
unspecified
,logs2metrics
]Example:
logs2metrics
E2M unique ID, required on update requests
Possible values: length = 36, Value must match regular expression
^[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
Description of the E2M
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
avg and max the latency of catalog service
E2M create time
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
2022-06-30T12:30:00Z'
E2M update time
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
2022-06-30T12:30:00Z'
Represents the limit of the permutations and if the limit was exceeded
E2M metric labels
Possible values: 0 ≤ number of items ≤ 4096
E2M metric fields
Possible values: 0 ≤ number of items ≤ 10
A flag that represents if the e2m is for internal usage
Example:
true
- One of
E2M represents the Event to metrics base model.
E2M unique ID, required on update requests.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:d6a3658e-78d2-47d0-9b81-b2c551f01b09
Name of the E2M.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Service_catalog_latency
Description of the E2M.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:avg and max the latency of catalog service
E2M create time.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:2022-06-30T12:30:00Z'
E2M update time.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:2022-06-30T12:30:00Z'
Represents the limit of the permutations and if the limit was exceeded.
- Permutations
E2M permutation limit.
Examples:30000
Flag to indicate if limit was exceeded.
Examples:true
E2M metric labels.
Possible values: 0 ≤ number of items ≤ 4096
- MetricLabels
Metric label target alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_label_name
Metric label source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.string_value
E2M metric fields.
Possible values: 0 ≤ number of items ≤ 10
- MetricFields
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_field_name
Source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field
Represents Aggregation type list.
Possible values: 0 ≤ number of items ≤ 4096
- Aggregations
Represents Aggregation type list.
- ApisEvents2metricsV2Aggregation
Is enabled.
Examples:true
Aggregation type.
Possible values: [
unspecified
,min
,max
,count
,avg
,sum
,histogram
,samples
]Examples:samples
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:alias_field_name_agg_func
E2M sample type metadata.
- Samples
Sample type min/max.
Possible values: [
unspecified
,min
,max
]Examples:max
E2M type.
Possible values: [
unspecified
,logs2metrics
]Examples:logs2metrics
A flag that represents if the e2m is for internal usage.
Examples:true
E2M logs query.
- LogsQuery
Lucene query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field: [50 TO 100]
Alias.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:new_query
Application name filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "app_name" ]
Subsystem names filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "sub_name" ]
Severity type filters.
Possible values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "create_time": "2024-03-11T10:38:21.000Z", "description": "Test e2m updated", "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de", "is_internal": true, "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations": { "limit": 1 }, "type": "logs2metrics", "update_time": "2024-03-11T10:38:21.000Z" }
{ "create_time": "2024-03-11T10:38:21.000Z", "description": "Test e2m updated", "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de", "is_internal": true, "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations": { "limit": 1 }, "type": "logs2metrics", "update_time": "2024-03-11T10:38:21.000Z" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Updates event to metrics definitions
Updates event to metrics definitions
Updates event to metrics definitions.
PUT /v1/events2metrics/{id}
(logs *LogsV0) ReplaceE2m(replaceE2mOptions *ReplaceE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) ReplaceE2mWithContext(ctx context.Context, replaceE2mOptions *ReplaceE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)
Request
Instantiate the ReplaceE2mOptions
struct and set the fields to provide parameter values for the ReplaceE2m
method.
Path Parameters
ID of e2m to be deleted
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
d6a3658e-78d2-47d0-9b81-b2c551f01b09
E2M Create message
{
"description": "Test e2m updated",
"logs_query": {
"lucene": "logs"
},
"name": "test em2",
"permutations_limit": 1,
"type": "logs2metrics"
}
Name of E2M to create
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Service catalog latency
Description of E2M to create
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
avg and max the latency of catalog service
The permutation limit of the E2M
Example:
30000
E2M metric labels
Possible values: 0 ≤ number of items ≤ 4096
E2M metric fields
Possible values: 0 ≤ number of items ≤ 4096
E2M type
Allowable values: [
unspecified
,logs2metrics
]Example:
logs2metrics
- One of
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The ReplaceE2m options.
ID of e2m to be deleted.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:d6a3658e-78d2-47d0-9b81-b2c551f01b09
E2M Create message.
- Event2MetricPrototype
Name of E2M to create.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Service catalog latency
Description of E2M to create.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:avg and max the latency of catalog service
The permutation limit of the E2M.
Examples:30000
E2M metric labels.
Possible values: 0 ≤ number of items ≤ 4096
- MetricLabels
Metric label target alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_label_name
Metric label source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.string_value
E2M metric fields.
Possible values: 0 ≤ number of items ≤ 4096
- MetricFields
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_field_name
Source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field
Represents Aggregation type list.
Possible values: 0 ≤ number of items ≤ 4096
- Aggregations
Represents Aggregation type list.
- ApisEvents2metricsV2Aggregation
Is enabled.
Examples:true
Aggregation type.
Allowable values: [
unspecified
,min
,max
,count
,avg
,sum
,histogram
,samples
]Examples:samples
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:alias_field_name_agg_func
E2M sample type metadata.
- Samples
Sample type min/max.
Allowable values: [
unspecified
,min
,max
]Examples:max
E2M type.
Allowable values: [
unspecified
,logs2metrics
]Examples:logs2metrics
E2M logs query.
- LogsQuery
Lucene query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field: [50 TO 100]
Alias.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:new_query
Application name filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "app_name" ]
Subsystem names filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "sub_name" ]
Severity type filters.
Allowable values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
curl -X PUT --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "description": "Test e2m updated", "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations_limit": 1, "type": "logs2metrics" }' "${base_url}/v1/events2metrics/${id}"
apisLogs2metricsV2LogsQueryModel := &logsv0.ApisLogs2metricsV2LogsQuery{ Lucene: core.StringPtr("logs"), } event2MetricPrototypeModel := &logsv0.Event2MetricPrototypeApisEvents2metricsV2E2mCreateParamsQueryLogsQuery{ Name: core.StringPtr("test em2"), Description: core.StringPtr("Test e2m updated"), PermutationsLimit: core.Int64Ptr(int64(1)), Type: core.StringPtr("logs2metrics"), LogsQuery: apisLogs2metricsV2LogsQueryModel, } replaceE2mOptions := logsService.NewReplaceE2mOptions( "d6a3658e-78d2-47d0-9b81-b2c551f01b09", event2MetricPrototypeModel, ) event2Metric, response, err := logsService.ReplaceE2m(replaceE2mOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(event2Metric, "", " ") fmt.Println(string(b))
Response
E2M represents the Event to metrics base model.
Name of the E2M
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Service_catalog_latency
E2M type
Possible values: [
unspecified
,logs2metrics
]Example:
logs2metrics
E2M unique ID, required on update requests
Possible values: length = 36, Value must match regular expression
^[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
Description of the E2M
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
avg and max the latency of catalog service
E2M create time
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
2022-06-30T12:30:00Z'
E2M update time
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
2022-06-30T12:30:00Z'
Represents the limit of the permutations and if the limit was exceeded
E2M metric labels
Possible values: 0 ≤ number of items ≤ 4096
E2M metric fields
Possible values: 0 ≤ number of items ≤ 10
A flag that represents if the e2m is for internal usage
Example:
true
- One of
E2M represents the Event to metrics base model.
E2M unique ID, required on update requests.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:d6a3658e-78d2-47d0-9b81-b2c551f01b09
Name of the E2M.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Service_catalog_latency
Description of the E2M.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:avg and max the latency of catalog service
E2M create time.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:2022-06-30T12:30:00Z'
E2M update time.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:2022-06-30T12:30:00Z'
Represents the limit of the permutations and if the limit was exceeded.
- Permutations
E2M permutation limit.
Examples:30000
Flag to indicate if limit was exceeded.
Examples:true
E2M metric labels.
Possible values: 0 ≤ number of items ≤ 4096
- MetricLabels
Metric label target alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_label_name
Metric label source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.string_value
E2M metric fields.
Possible values: 0 ≤ number of items ≤ 10
- MetricFields
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[\\w\/-]+$/
Examples:alias_field_name
Source field.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field
Represents Aggregation type list.
Possible values: 0 ≤ number of items ≤ 4096
- Aggregations
Represents Aggregation type list.
- ApisEvents2metricsV2Aggregation
Is enabled.
Examples:true
Aggregation type.
Possible values: [
unspecified
,min
,max
,count
,avg
,sum
,histogram
,samples
]Examples:samples
Target metric field alias name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:alias_field_name_agg_func
E2M sample type metadata.
- Samples
Sample type min/max.
Possible values: [
unspecified
,min
,max
]Examples:max
E2M type.
Possible values: [
unspecified
,logs2metrics
]Examples:logs2metrics
A flag that represents if the e2m is for internal usage.
Examples:true
E2M logs query.
- LogsQuery
Lucene query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:log_obj.numeric_field: [50 TO 100]
Alias.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:new_query
Application name filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "app_name" ]
Subsystem names filters.
Possible values: 0 ≤ number of items ≤ 4096, 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:[ "sub_name" ]
Severity type filters.
Possible values: [
unspecified
,debug
,verbose
,info
,warning
,error
,critical
]Possible values: 0 ≤ number of items ≤ 4096
Examples:[ "critical" ]
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "create_time": "2024-03-11T10:38:21.000Z", "description": "Test e2m updated", "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de", "is_internal": true, "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations": { "limit": 1 }, "type": "logs2metrics", "update_time": "2024-03-11T10:38:21.000Z" }
{ "create_time": "2024-03-11T10:38:21.000Z", "description": "Test e2m updated", "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de", "is_internal": true, "logs_query": { "lucene": "logs" }, "name": "test em2", "permutations": { "limit": 1 }, "type": "logs2metrics", "update_time": "2024-03-11T10:38:21.000Z" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Deletes event to metrics definitions by id
Deletes event to metrics definitions by id
Deletes event to metrics definitions by id.
DELETE /v1/events2metrics/{id}
(logs *LogsV0) DeleteE2m(deleteE2mOptions *DeleteE2mOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteE2mWithContext(ctx context.Context, deleteE2mOptions *DeleteE2mOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteE2mOptions
struct and set the fields to provide parameter values for the DeleteE2m
method.
Path Parameters
ID of e2m to be deleted
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
d6a3658e-78d2-47d0-9b81-b2c551f01b09
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteE2m options.
ID of e2m to be deleted.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:d6a3658e-78d2-47d0-9b81-b2c551f01b09
curl -X DELETE --location --header "Authorization: Bearer ${iam_token}" "${base_url}/v1/events2metrics/${id}"
deleteE2mOptions := logsService.NewDeleteE2mOptions( "d6a3658e-78d2-47d0-9b81-b2c551f01b09", ) response, err := logsService.DeleteE2m(deleteE2mOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteE2m(): %d\n", response.StatusCode) }
Response
Status Code
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Run a query to search the logs
Run a query to search the logs
Run a query to search the logs.
POST /v1/query
(logs *LogsV0) Query(queryOptions *QueryOptions) (result QueryResponseStreamItemIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) QueryWithContext(ctx context.Context, queryOptions *QueryOptions) (result QueryResponseStreamItemIntf, response *core.DetailedResponse, err error)
Request
Instantiate the QueryOptions
struct and set the fields to provide parameter values for the Query
method.
Query request
The query for which you are seeking results
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
source logs | filter $d.apiVersion == 42
Configuration for query execution
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The Query options.
The query for which you are seeking results.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:source logs | filter $d.apiVersion == 42
Configuration for query execution.
- Metadata
Beginning of the time range for the query. Default: end - 15 min or current time - 15 min if end is not defined.
Examples:2021-01-01T00:00:00.000Z
End of the time range for the query. Default: start + 15 min or current time if start is not defined.
Examples:2021-01-01T00:00:00.000Z
Default value for the source to be used when the source is omitted in a query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:logs
Tier on which the query runs.
Allowable values: [
unspecified
,archive
,frequent_search
]Examples:frequent_search
The syntax in which the query is written.
Allowable values: [
unspecified
,lucene
,dataprime
]Examples:dataprime
Limit the number of results. Default: 2000; max for TIER_FREQUENT_SEARCH: 12000; max for TIER_ARCHIVE: 50000.
Examples:2000
Prohibit the use of unknown fields, i.e., those not detected in the ingested data. Default: false.
Examples:true
curl -X POST --location --header "Authorization: Bearer ${iam_token}" --header "Accept: text/event-stream" --header "Content-Type: application/json" --data '{ "query": "source logs | limit 10", "metadata": { "start_date": "2024-05-01T20:47:12.940Z", "end_date": "2024-05-02T22:47:12.940Z", "tier": "frequent_search", "syntax": "dataprime", "limit": 100, "strict_fields_validation": false } }' "{base_url}/v1/query"
queryOptions := logsv0.QueryOptions{ Query: core.StringPtr("source logs | limit 10"), Metadata: &logsv0.ApisDataprimeV1Metadata{ StartDate: CreateDateTime("2024-03-01T20:47:12.940Z"), EndDate: CreateDateTime("2024-03-06T20:47:12.940Z"), Tier: core.StringPtr("frequent_search"), Syntax: core.StringPtr("dataprime"), }, } var wg sync.WaitGroup wg.Add(1.) go func() { logsService.QueryWithContext(context.Background(), &queryOptions, callBack{}) wg.Done() }() wg.Wait()
Response
Response for a text query.
Response for a text query.
Error message.
- Error
Human-readable error message.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Failed to run the query 1/archive/3424/4rwoNx1XNcc
Error code.
- Code
Rate limit reached error.
Result message.
- Result
Results of the query.
Possible values: 0 ≤ number of items ≤ 4096
- Results
Metadata of the result.
Possible values: 0 ≤ number of items ≤ 4096
- Metadata
Key of the result.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:subsystemname
Value of the result.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:agent
Labels of the result.
Possible values: 0 ≤ number of items ≤ 4096
- Labels
Key of the result.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:subsystemname
Value of the result.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:agent
Data of the result.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:{ "text": "event1" }
Warning message.
- Warning
Warning from Dataprime compilation.
- CompileWarning
Warning message.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:keypath does not exist '$d.foo' in line 0 at column 21
Internal identifier of the query.
- QueryID
Unique identifier of the query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:4rwoNx1XNcc
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Lists all company public views
Lists all company public views
Lists all company public views.
GET /v1/views
(logs *LogsV0) ListViews(listViewsOptions *ListViewsOptions) (result *ViewCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListViewsWithContext(ctx context.Context, listViewsOptions *ListViewsOptions) (result *ViewCollection, response *core.DetailedResponse, err error)
Request
No Request Parameters
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/views"
listViewsOptions := logsService.NewListViewsOptions() viewCollection, response, err := logsService.ListViews(listViewsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(viewCollection, "", " ") fmt.Println(string(b))
Response
List of views
List of views
Possible values: 0 ≤ number of items ≤ 4096
List of views.
{
"views": [
{
"filters": {
"filters": [
{
"name": "applicationName",
"selected_values": {
"demo": true
}
},
{
"name": "subsystemName",
"selected_values": {
"demo": true
}
},
{
"name": "operationName",
"selected_values": {
"demo": true
}
},
{
"name": "serviceName",
"selected_values": {
"demo": true
}
},
{
"name": "severity",
"selected_values": {
"demo": true
}
}
]
},
"id": 52,
"name": "Logs view",
"search_query": {
"query": "logs"
},
"time_selection": {
"custom_selection": {
"from_time": "2024-01-25T11:31:43.152Z",
"to_time": "2024-01-25T11:37:13.238Z"
}
}
}
]
}
List of views.
Possible values: 0 ≤ number of items ≤ 4096
Examples:{ "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "id": 52, "name": "Logs view", "search_query": { "query": "logs" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } }
- Views
View ID.
Examples:52
View name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Logs view
View search query.
- SearchQuery
View search query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:error
View time selection.
- TimeSelection
Quick time selection.
- QuickSelection
Quick time selection caption.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Last hour
Quick time selection amount of seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:3600
View selected filters.
- Filters
Selected filters.
Possible values: 1 ≤ number of items ≤ 4096
- Filters
Filter name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:applicationName
Filter selected values.
Examples:{ "cs-rest-test1": true, "demo": true }
View folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "views": [ { "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "id": 52, "name": "Logs view", "search_query": { "query": "logs" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } } ] }
{ "views": [ { "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "id": 52, "name": "Logs view", "search_query": { "query": "logs" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Creates a new view
Creates a new view
Creates a new view.
POST /v1/views
(logs *LogsV0) CreateView(createViewOptions *CreateViewOptions) (result *View, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateViewWithContext(ctx context.Context, createViewOptions *CreateViewOptions) (result *View, response *core.DetailedResponse, err error)
Request
Instantiate the CreateViewOptions
struct and set the fields to provide parameter values for the CreateView
method.
Request to create/update a view
{
"filters": {
"filters": [
{
"name": "applicationName",
"selected_values": {
"demo": true
}
},
{
"name": "subsystemName",
"selected_values": {
"demo": true
}
},
{
"name": "operationName",
"selected_values": {
"demo": true
}
},
{
"name": "serviceName",
"selected_values": {
"demo": true
}
},
{
"name": "severity",
"selected_values": {
"demo": true
}
}
]
},
"name": "Logs view",
"search_query": {
"query": "logs"
},
"time_selection": {
"custom_selection": {
"from_time": "2024-01-25T11:31:43.152Z",
"to_time": "2024-01-25T11:37:13.238Z"
}
}
}
View name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Logs view
View time selection
View search query
View selected filters
View folder ID
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateView options.
View name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Logs view
View time selection.
- TimeSelection
Quick time selection.
- QuickSelection
Quick time selection caption.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Last hour
Quick time selection amount of seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:3600
View search query.
Examples:{ "query": "logs" }
- SearchQuery
View search query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:error
View selected filters.
Examples:{ "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }
- Filters
Selected filters.
Possible values: 1 ≤ number of items ≤ 4096
- Filters
Filter name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:applicationName
Filter selected values.
Examples:{ "cs-rest-test1": true, "demo": true }
View folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
curl -X POST --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "name": "Logs view", "search_query": { "query": "logs" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } }' "${base_url}/v1/views"
apisViewsV1CustomTimeSelectionModel := &logsv0.ApisViewsV1CustomTimeSelection{ FromTime: CreateMockDateTime("2024-01-25T11:31:43.152Z"), ToTime: CreateMockDateTime("2024-01-25T11:37:13.238Z"), } apisViewsV1TimeSelectionModel := &logsv0.ApisViewsV1TimeSelectionSelectionTypeCustomSelection{ CustomSelection: apisViewsV1CustomTimeSelectionModel, } apisViewsV1SearchQueryModel := &logsv0.ApisViewsV1SearchQuery{ Query: core.StringPtr("logs"), } apisViewsV1FilterModel := &logsv0.ApisViewsV1Filter{ Name: core.StringPtr("applicationName"), SelectedValues: map[string]bool{"key1": true}, } apisViewsV1SelectedFiltersModel := &logsv0.ApisViewsV1SelectedFilters{ Filters: []logsv0.ApisViewsV1Filter{*apisViewsV1FilterModel}, } createViewOptions := logsService.NewCreateViewOptions( "Logs view", apisViewsV1TimeSelectionModel, ) createViewOptions.SetSearchQuery(apisViewsV1SearchQueryModel) createViewOptions.SetFilters(apisViewsV1SelectedFiltersModel) view, response, err := logsService.CreateView(createViewOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(view, "", " ") fmt.Println(string(b))
Response
View
View ID
Example:
52
View name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Logs view
View time selection
View search query
View selected filters
View folder ID
Possible values: length = 36, Value must match regular expression
^[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
View.
{
"filters": {
"filters": [
{
"name": "applicationName",
"selected_values": {
"demo": true
}
},
{
"name": "subsystemName",
"selected_values": {
"demo": true
}
},
{
"name": "operationName",
"selected_values": {
"demo": true
}
},
{
"name": "serviceName",
"selected_values": {
"demo": true
}
},
{
"name": "severity",
"selected_values": {
"demo": true
}
}
]
},
"id": 52,
"name": "Logs view",
"search_query": {
"query": "logs"
},
"time_selection": {
"custom_selection": {
"from_time": "2024-01-25T11:31:43.152Z",
"to_time": "2024-01-25T11:37:13.238Z"
}
}
}
View ID.
Examples:52
View name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Logs view
View search query.
- SearchQuery
View search query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:error
View time selection.
- TimeSelection
Quick time selection.
- QuickSelection
Quick time selection caption.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Last hour
Quick time selection amount of seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:3600
View selected filters.
- Filters
Selected filters.
Possible values: 1 ≤ number of items ≤ 4096
- Filters
Filter name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:applicationName
Filter selected values.
Examples:{ "cs-rest-test1": true, "demo": true }
View folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Status Code
Created
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "id": 52, "name": "Logs view", "search_query": { "query": "logs" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } }
{ "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "id": 52, "name": "Logs view", "search_query": { "query": "logs" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Gets a view by ID
Gets a view by ID
Gets a view by ID.
GET /v1/views/{id}
(logs *LogsV0) GetView(getViewOptions *GetViewOptions) (result *View, response *core.DetailedResponse, err error)
(logs *LogsV0) GetViewWithContext(ctx context.Context, getViewOptions *GetViewOptions) (result *View, response *core.DetailedResponse, err error)
Request
Instantiate the GetViewOptions
struct and set the fields to provide parameter values for the GetView
method.
Path Parameters
View ID
Example:
52
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetView options.
View ID.
Examples:52
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/views/${id}"
getViewOptions := logsService.NewGetViewOptions( int64(52), ) view, response, err := logsService.GetView(getViewOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(view, "", " ") fmt.Println(string(b))
Response
View
View ID
Example:
52
View name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Logs view
View time selection
View search query
View selected filters
View folder ID
Possible values: length = 36, Value must match regular expression
^[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
View.
{
"filters": {
"filters": [
{
"name": "applicationName",
"selected_values": {
"demo": true
}
},
{
"name": "subsystemName",
"selected_values": {
"demo": true
}
},
{
"name": "operationName",
"selected_values": {
"demo": true
}
},
{
"name": "serviceName",
"selected_values": {
"demo": true
}
},
{
"name": "severity",
"selected_values": {
"demo": true
}
}
]
},
"id": 52,
"name": "Logs view",
"search_query": {
"query": "logs"
},
"time_selection": {
"custom_selection": {
"from_time": "2024-01-25T11:31:43.152Z",
"to_time": "2024-01-25T11:37:13.238Z"
}
}
}
View ID.
Examples:52
View name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Logs view
View search query.
- SearchQuery
View search query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:error
View time selection.
- TimeSelection
Quick time selection.
- QuickSelection
Quick time selection caption.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Last hour
Quick time selection amount of seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:3600
View selected filters.
- Filters
Selected filters.
Possible values: 1 ≤ number of items ≤ 4096
- Filters
Filter name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:applicationName
Filter selected values.
Examples:{ "cs-rest-test1": true, "demo": true }
View folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "id": 52, "name": "Logs view", "search_query": { "query": "logs" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } }
{ "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "id": 52, "name": "Logs view", "search_query": { "query": "logs" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Replaces an existing view
Replaces an existing view
Replaces an existing view.
PUT /v1/views/{id}
(logs *LogsV0) ReplaceView(replaceViewOptions *ReplaceViewOptions) (result *View, response *core.DetailedResponse, err error)
(logs *LogsV0) ReplaceViewWithContext(ctx context.Context, replaceViewOptions *ReplaceViewOptions) (result *View, response *core.DetailedResponse, err error)
Request
Instantiate the ReplaceViewOptions
struct and set the fields to provide parameter values for the ReplaceView
method.
Path Parameters
View ID
Example:
52
Request to create/update a view
{
"filters": {
"filters": [
{
"name": "applicationName",
"selected_values": {
"demo": true
}
},
{
"name": "subsystemName",
"selected_values": {
"demo": true
}
},
{
"name": "operationName",
"selected_values": {
"demo": true
}
},
{
"name": "serviceName",
"selected_values": {
"demo": true
}
},
{
"name": "severity",
"selected_values": {
"demo": true
}
}
]
},
"name": "Logs view",
"search_query": {
"query": "logs new"
},
"time_selection": {
"custom_selection": {
"from_time": "2024-01-25T11:31:43.152Z",
"to_time": "2024-01-25T11:37:13.238Z"
}
}
}
View name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Logs view
View time selection
View search query
View selected filters
View folder ID
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The ReplaceView options.
View ID.
Examples:52
View name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Logs view
View time selection.
- TimeSelection
Quick time selection.
- QuickSelection
Quick time selection caption.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Last hour
Quick time selection amount of seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:3600
View search query.
Examples:{ "query": "logs new" }
- SearchQuery
View search query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:error
View selected filters.
Examples:{ "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }
- Filters
Selected filters.
Possible values: 1 ≤ number of items ≤ 4096
- Filters
Filter name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:applicationName
Filter selected values.
Examples:{ "cs-rest-test1": true, "demo": true }
View folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
curl -X PUT --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "name": "Logs view", "search_query": { "query": "logs new" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } }' "${base_url}/v1/views/${id}"
apisViewsV1CustomTimeSelectionModel := &logsv0.ApisViewsV1CustomTimeSelection{ FromTime: CreateMockDateTime("2024-01-25T11:31:43.152Z"), ToTime: CreateMockDateTime("2024-01-25T11:37:13.238Z"), } apisViewsV1TimeSelectionModel := &logsv0.ApisViewsV1TimeSelectionSelectionTypeCustomSelection{ CustomSelection: apisViewsV1CustomTimeSelectionModel, } apisViewsV1SearchQueryModel := &logsv0.ApisViewsV1SearchQuery{ Query: core.StringPtr("logs new"), } apisViewsV1FilterModel := &logsv0.ApisViewsV1Filter{ Name: core.StringPtr("applicationName"), SelectedValues: map[string]bool{"key1": true}, } apisViewsV1SelectedFiltersModel := &logsv0.ApisViewsV1SelectedFilters{ Filters: []logsv0.ApisViewsV1Filter{*apisViewsV1FilterModel}, } replaceViewOptions := logsService.NewReplaceViewOptions( int64(52), "Logs view", apisViewsV1TimeSelectionModel, ) replaceViewOptions.SetSearchQuery(apisViewsV1SearchQueryModel) replaceViewOptions.SetFilters(apisViewsV1SelectedFiltersModel) view, response, err := logsService.ReplaceView(replaceViewOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(view, "", " ") fmt.Println(string(b))
Response
View
View ID
Example:
52
View name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Logs view
View time selection
View search query
View selected filters
View folder ID
Possible values: length = 36, Value must match regular expression
^[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
View.
{
"filters": {
"filters": [
{
"name": "applicationName",
"selected_values": {
"demo": true
}
},
{
"name": "subsystemName",
"selected_values": {
"demo": true
}
},
{
"name": "operationName",
"selected_values": {
"demo": true
}
},
{
"name": "serviceName",
"selected_values": {
"demo": true
}
},
{
"name": "severity",
"selected_values": {
"demo": true
}
}
]
},
"id": 52,
"name": "Logs view",
"search_query": {
"query": "logs"
},
"time_selection": {
"custom_selection": {
"from_time": "2024-01-25T11:31:43.152Z",
"to_time": "2024-01-25T11:37:13.238Z"
}
}
}
View ID.
Examples:52
View name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Logs view
View search query.
- SearchQuery
View search query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:error
View time selection.
- TimeSelection
Quick time selection.
- QuickSelection
Quick time selection caption.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Last hour
Quick time selection amount of seconds.
Possible values: 0 ≤ value ≤ 4294967295
Examples:3600
View selected filters.
- Filters
Selected filters.
Possible values: 1 ≤ number of items ≤ 4096
- Filters
Filter name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:applicationName
Filter selected values.
Examples:{ "cs-rest-test1": true, "demo": true }
View folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "id": 52, "name": "Logs view", "search_query": { "query": "logs" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } }
{ "filters": { "filters": [ { "name": "applicationName", "selected_values": { "demo": true } }, { "name": "subsystemName", "selected_values": { "demo": true } }, { "name": "operationName", "selected_values": { "demo": true } }, { "name": "serviceName", "selected_values": { "demo": true } }, { "name": "severity", "selected_values": { "demo": true } } ] }, "id": 52, "name": "Logs view", "search_query": { "query": "logs" }, "time_selection": { "custom_selection": { "from_time": "2024-01-25T11:31:43.152Z", "to_time": "2024-01-25T11:37:13.238Z" } } }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Deletes a view by ID
Deletes a view by ID
Deletes a view by ID.
DELETE /v1/views/{id}
(logs *LogsV0) DeleteView(deleteViewOptions *DeleteViewOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteViewWithContext(ctx context.Context, deleteViewOptions *DeleteViewOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteViewOptions
struct and set the fields to provide parameter values for the DeleteView
method.
Path Parameters
View ID
Example:
52
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteView options.
View ID.
Examples:52
curl -X DELETE --location --header "Authorization: Bearer ${iam_token}" "${base_url}/v1/views/${id}"
deleteViewOptions := logsService.NewDeleteViewOptions( int64(52), ) response, err := logsService.DeleteView(deleteViewOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteView(): %d\n", response.StatusCode) }
Response
Status Code
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
List view's folders
List view's folders
List view's folders.
GET /v1/view_folders
(logs *LogsV0) ListViewFolders(listViewFoldersOptions *ListViewFoldersOptions) (result *ViewFolderCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListViewFoldersWithContext(ctx context.Context, listViewFoldersOptions *ListViewFoldersOptions) (result *ViewFolderCollection, response *core.DetailedResponse, err error)
Request
No Request Parameters
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/view_folders"
listViewFoldersOptions := logsService.NewListViewFoldersOptions() viewFolderCollection, response, err := logsService.ListViewFolders(listViewFoldersOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(viewFolderCollection, "", " ") fmt.Println(string(b))
Response
List view's folders response
List of view folders
Possible values: 0 ≤ number of items ≤ 4096
List view's folders response.
{
"view_folders": [
{
"id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
"name": "My Folder"
}
]
}
List of view folders.
Possible values: 0 ≤ number of items ≤ 4096
Examples:{ "id": "0cd4ed54-9b59-4eef-b329-151a167e2304", "name": "My Folder" }
- ViewFolders
Folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Folder name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:My Folder
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "view_folders": [ { "id": "0cd4ed54-9b59-4eef-b329-151a167e2304", "name": "My Folder" } ] }
{ "view_folders": [ { "id": "0cd4ed54-9b59-4eef-b329-151a167e2304", "name": "My Folder" } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Create view folder
Create view folder
Create view folder.
POST /v1/view_folders
(logs *LogsV0) CreateViewFolder(createViewFolderOptions *CreateViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateViewFolderWithContext(ctx context.Context, createViewFolderOptions *CreateViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)
Request
Instantiate the CreateViewFolderOptions
struct and set the fields to provide parameter values for the CreateViewFolder
method.
Create view folder
{
"name": "My Folder"
}
View folder name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
My folder
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateViewFolder options.
View folder name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:My Folder
curl -X POST --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "My Folder" }' "${base_url}/v1/view_folders"
createViewFolderOptions := logsService.NewCreateViewFolderOptions( "My Folder", ) viewFolder, response, err := logsService.CreateViewFolder(createViewFolderOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(viewFolder, "", " ") fmt.Println(string(b))
Response
View folder
Folder name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
My Folder
Folder ID
Possible values: length = 36, Value must match regular expression
^[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
View folder.
{
"id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
"name": "My Folder"
}
Folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Folder name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:My Folder
Status Code
Created
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "id": "0cd4ed54-9b59-4eef-b329-151a167e2304", "name": "My Folder" }
{ "id": "0cd4ed54-9b59-4eef-b329-151a167e2304", "name": "My Folder" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Get view folder
Get view folder
Get view folder.
GET /v1/view_folders/{id}
(logs *LogsV0) GetViewFolder(getViewFolderOptions *GetViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)
(logs *LogsV0) GetViewFolderWithContext(ctx context.Context, getViewFolderOptions *GetViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)
Request
Instantiate the GetViewFolderOptions
struct and set the fields to provide parameter values for the GetViewFolder
method.
Path Parameters
Folder ID
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetViewFolder options.
Folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/view_folders/${id}"
getViewFolderOptions := logsService.NewGetViewFolderOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), ) viewFolder, response, err := logsService.GetViewFolder(getViewFolderOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(viewFolder, "", " ") fmt.Println(string(b))
Response
View folder
Folder name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
My Folder
Folder ID
Possible values: length = 36, Value must match regular expression
^[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
View folder.
{
"id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
"name": "My Folder"
}
Folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Folder name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:My Folder
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "id": "0cd4ed54-9b59-4eef-b329-151a167e2304", "name": "My Folder" }
{ "id": "0cd4ed54-9b59-4eef-b329-151a167e2304", "name": "My Folder" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Replaces an existing view folder
Replaces an existing view folder
Replaces an existing view folder.
PUT /v1/view_folders/{id}
(logs *LogsV0) ReplaceViewFolder(replaceViewFolderOptions *ReplaceViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)
(logs *LogsV0) ReplaceViewFolderWithContext(ctx context.Context, replaceViewFolderOptions *ReplaceViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)
Request
Instantiate the ReplaceViewFolderOptions
struct and set the fields to provide parameter values for the ReplaceViewFolder
method.
Path Parameters
Folder ID
Possible values: length = 36, Value must match regular expression
^[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
Create view folder
{
"name": "My Folder"
}
View folder name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
My folder
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The ReplaceViewFolder options.
Folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
View folder name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:My Folder
curl -X PUT --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "My Folder" }' "${base_url}/v1/view_folders/${id}"
replaceViewFolderOptions := logsService.NewReplaceViewFolderOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), "My Folder", ) viewFolder, response, err := logsService.ReplaceViewFolder(replaceViewFolderOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(viewFolder, "", " ") fmt.Println(string(b))
Response
View folder
Folder name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
My Folder
Folder ID
Possible values: length = 36, Value must match regular expression
^[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
View folder.
{
"id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
"name": "My Folder"
}
Folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Folder name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:My Folder
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "id": "0cd4ed54-9b59-4eef-b329-151a167e2304", "name": "My Folder" }
{ "id": "0cd4ed54-9b59-4eef-b329-151a167e2304", "name": "My Folder" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Deletes a view folder by ID
Deletes a view folder by ID
Deletes a view folder by ID.
DELETE /v1/view_folders/{id}
(logs *LogsV0) DeleteViewFolder(deleteViewFolderOptions *DeleteViewFolderOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteViewFolderWithContext(ctx context.Context, deleteViewFolderOptions *DeleteViewFolderOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteViewFolderOptions
struct and set the fields to provide parameter values for the DeleteViewFolder
method.
Path Parameters
Folder ID
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteViewFolder options.
Folder ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
curl -X DELETE --location --header "Authorization: Bearer ${iam_token}" "${base_url}/v1/view_folders/${id}"
deleteViewFolderOptions := logsService.NewDeleteViewFolderOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), ) response, err := logsService.DeleteViewFolder(deleteViewFolderOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteViewFolder(): %d\n", response.StatusCode) }
Response
Status Code
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
List service instance's Data Access Rules with provided ids
List service instance's Data Access Rules with provided ids
List service instance's Data Access Rules with provided ids.
GET /v1/data_access_rules
(logs *LogsV0) ListDataAccessRules(listDataAccessRulesOptions *ListDataAccessRulesOptions) (result *DataAccessRuleCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListDataAccessRulesWithContext(ctx context.Context, listDataAccessRulesOptions *ListDataAccessRulesOptions) (result *DataAccessRuleCollection, response *core.DetailedResponse, err error)
Request
Instantiate the ListDataAccessRulesOptions
struct and set the fields to provide parameter values for the ListDataAccessRules
method.
Query Parameters
Array of data access rule IDs
Possible values: 0 ≤ number of items ≤ 4096, length = 36, Value must match regular expression
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Examples:[ "4f966911-4bda-407e-b069-477394effa59" ]
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The ListDataAccessRules options.
Array of data access rule IDs.
Possible values: 0 ≤ number of items ≤ 4096, length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:[ "4f966911-4bda-407e-b069-477394effa59" ]
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/data_access_rules?id=4f966911-4bda-407e-b069-477394effa59"
listDataAccessRulesOptions := logsService.NewListDataAccessRulesOptions() listDataAccessRulesOptions.SetID([]strfmt.UUID{"4f966911-4bda-407e-b069-477394effa59"}) dataAccessRuleCollection, response, err := logsService.ListDataAccessRules(listDataAccessRulesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(dataAccessRuleCollection, "", " ") fmt.Println(string(b))
Response
Get Data Access Rules Response
Data Access Rule details
Possible values: 0 ≤ number of items ≤ 4096
Get Data Access Rules Response.
{
"data_access_rules": [
{
"default_expression": "<v1> foo == 'bar'",
"description": "Data Access Rule intended for testing",
"display_name": "Test Data Access Rule",
"filters": [
{
"entity_type": "logs",
"expression": "<v1> foo == 'bar'"
}
],
"id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
}
]
}
Data Access Rule details.
Possible values: 0 ≤ number of items ≤ 4096
Examples:{ "default_expression": "<v1> foo == 'bar'", "description": "Data Access Rule intended for testing", "display_name": "Test Data Access Rule", "filters": [ { "entity_type": "logs", "expression": "<v1> foo == 'bar'" } ], "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff" }
- DataAccessRules
Data Access Rule ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Data Access Rule Display Name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Data Access Rule for group 'users'
Optional Data Access Rule Description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Data Access Rule that defines restriction on 'users' group
List of filters that the Data Access Rule is composed of.
Possible values: 0 ≤ number of items ≤ 4096
- Filters
Filter's Entity Type.
Possible values: [
unspecified
,logs
]Examples:logs
Filter's Expression.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|'<> ]+$/
Examples:true
Default expression to use when no filter matches the query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|'<> ]+$/
Examples:true
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "data_access_rules": [ { "default_expression": "<v1> foo == 'bar'", "description": "Data Access Rule intended for testing", "display_name": "Test Data Access Rule", "filters": [ { "entity_type": "logs", "expression": "<v1> foo == 'bar'" } ], "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff" } ] }
{ "data_access_rules": [ { "default_expression": "<v1> foo == 'bar'", "description": "Data Access Rule intended for testing", "display_name": "Test Data Access Rule", "filters": [ { "entity_type": "logs", "expression": "<v1> foo == 'bar'" } ], "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff" } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Create a Data Access Rule
Create a Data Access Rule
Create a Data Access Rule.
POST /v1/data_access_rules
(logs *LogsV0) CreateDataAccessRule(createDataAccessRuleOptions *CreateDataAccessRuleOptions) (result *DataAccessRule, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateDataAccessRuleWithContext(ctx context.Context, createDataAccessRuleOptions *CreateDataAccessRuleOptions) (result *DataAccessRule, response *core.DetailedResponse, err error)
Request
Instantiate the CreateDataAccessRuleOptions
struct and set the fields to provide parameter values for the CreateDataAccessRule
method.
Create Data Access Rule Request
{
"default_expression": "<v1> foo == 'bar'",
"description": "Data Access Rule intended for testing",
"display_name": "Test Data Access Rule",
"filters": [
{
"entity_type": "logs",
"expression": "<v1> foo == 'bar'"
}
]
}
Display Name for new Data Access Rule
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Data Access Rule for group 'users'
Filters for new Data Access Rule
Possible values: 0 ≤ number of items ≤ 4096
Default Expression for new Data Access Rule
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|'<> ]+$
Example:
true
Description for new Data Access Rule
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Data Access Rule that defines restriction on 'users' group
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateDataAccessRule options.
Display Name for new Data Access Rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Test Data Access Rule
Filters for new Data Access Rule.
Possible values: 0 ≤ number of items ≤ 4096
Examples:[ { "entity_type": "logs", "expression": "<v1> foo == 'bar'" } ]
- Filters
Filter's Entity Type.
Allowable values: [
unspecified
,logs
]Examples:logs
Filter's Expression.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|'<> ]+$/
Examples:true
Default Expression for new Data Access Rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|'<> ]+$/
Examples:<v1> foo == 'bar'
Description for new Data Access Rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Data Access Rule intended for testing
curl -X POST --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "default_expression": "<v1>true", "description": "Data Access Rule intended for testing", "display_name": "Test Data Access Rule", "filters": [ { "entity_type": "logs", "expression": "<v1> foo == bar" } ] }' "${base_url}/v1/data_access_rules"
dataAccessRuleFilterModel := &logsv0.DataAccessRuleFilter{ EntityType: core.StringPtr("logs"), Expression: core.StringPtr("<v1> foo == 'bar'"), } createDataAccessRuleOptions := logsService.NewCreateDataAccessRuleOptions( "Test Data Access Rule", []logsv0.DataAccessRuleFilter{*dataAccessRuleFilterModel}, "<v1>true", ) createDataAccessRuleOptions.SetDescription("Data Access Rule intended for testing") dataAccessRule, response, err := logsService.CreateDataAccessRule(createDataAccessRuleOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(dataAccessRule, "", " ") fmt.Println(string(b))
Response
Data Access Rule details
Data Access Rule ID
Possible values: length = 36, Value must match regular expression
^[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
Data Access Rule Display Name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Data Access Rule for group 'users'
Default expression to use when no filter matches the query
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|'<> ]+$
Example:
true
Optional Data Access Rule Description
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Data Access Rule that defines restriction on 'users' group
List of filters that the Data Access Rule is composed of
Possible values: 0 ≤ number of items ≤ 4096
Data Access Rule details.
{
"default_expression": "<v1> foo == 'bar'",
"description": "Data Access Rule intended for testing",
"display_name": "Test Data Access Rule",
"filters": [
{
"entity_type": "logs",
"expression": "<v1> foo == 'bar'"
}
],
"id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
}
Data Access Rule ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Data Access Rule Display Name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Data Access Rule for group 'users'
Optional Data Access Rule Description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Data Access Rule that defines restriction on 'users' group
List of filters that the Data Access Rule is composed of.
Possible values: 0 ≤ number of items ≤ 4096
- Filters
Filter's Entity Type.
Possible values: [
unspecified
,logs
]Examples:logs
Filter's Expression.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|'<> ]+$/
Examples:true
Default expression to use when no filter matches the query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|'<> ]+$/
Examples:true
Status Code
Created
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "default_expression": "<v1> foo == 'bar'", "description": "Data Access Rule intended for testing", "display_name": "Test Data Access Rule", "filters": [ { "entity_type": "logs", "expression": "<v1> foo == 'bar'" } ], "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff" }
{ "default_expression": "<v1> foo == 'bar'", "description": "Data Access Rule intended for testing", "display_name": "Test Data Access Rule", "filters": [ { "entity_type": "logs", "expression": "<v1> foo == 'bar'" } ], "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Update a Data Access Rule
Update a Data Access Rule
Update a Data Access Rule.
PUT /v1/data_access_rules/{id}
(logs *LogsV0) UpdateDataAccessRule(updateDataAccessRuleOptions *UpdateDataAccessRuleOptions) (result *DataAccessRule, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdateDataAccessRuleWithContext(ctx context.Context, updateDataAccessRuleOptions *UpdateDataAccessRuleOptions) (result *DataAccessRule, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateDataAccessRuleOptions
struct and set the fields to provide parameter values for the UpdateDataAccessRule
method.
Path Parameters
ID of Data Access Rule to be deleted
Possible values: length = 36, Value must match regular expression
^[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
Create Data Access Rule Request
{
"default_expression": "<v1> foo == 'bar'",
"description": "Data Access Rule intended for testing",
"display_name": "Test Data Access Rule",
"filters": [
{
"entity_type": "logs",
"expression": "<v1> foo == 'bar'"
}
]
}
Display Name for new Data Access Rule
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Data Access Rule for group 'users'
Filters for new Data Access Rule
Possible values: 0 ≤ number of items ≤ 4096
Default Expression for new Data Access Rule
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|'<> ]+$
Example:
true
Description for new Data Access Rule
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Data Access Rule that defines restriction on 'users' group
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The UpdateDataAccessRule options.
ID of Data Access Rule to be deleted.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Display Name for new Data Access Rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Test Data Access Rule
Filters for new Data Access Rule.
Possible values: 0 ≤ number of items ≤ 4096
Examples:[ { "entity_type": "logs", "expression": "<v1> foo == 'bar'" } ]
- Filters
Filter's Entity Type.
Allowable values: [
unspecified
,logs
]Examples:logs
Filter's Expression.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|'<> ]+$/
Examples:true
Default Expression for new Data Access Rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|'<> ]+$/
Examples:<v1> foo == 'bar'
Description for new Data Access Rule.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Data Access Rule intended for testing
curl -X PUT --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "default_expression": "<v1>true", "description": "Data Access Rule intended for testing", "display_name": "Test Data Access Rule", "filters": [ { "entity_type": "logs", "expression": "<v1> foo == bar" } ] }' "${base_url}/v1/data_access_rules/${id}"
dataAccessRuleFilterModel := &logsv0.DataAccessRuleFilter{ EntityType: core.StringPtr("logs"), Expression: core.StringPtr("<v1> foo == 'bar'"), } updateDataAccessRuleOptions := logsService.NewUpdateDataAccessRuleOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), "Test Data Access Rule", []logsv0.DataAccessRuleFilter{*dataAccessRuleFilterModel}, "<v1>true", ) updateDataAccessRuleOptions.SetDescription("Data Access Rule intended for testing") dataAccessRule, response, err := logsService.UpdateDataAccessRule(updateDataAccessRuleOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(dataAccessRule, "", " ") fmt.Println(string(b))
Response
Data Access Rule details
Data Access Rule ID
Possible values: length = 36, Value must match regular expression
^[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
Data Access Rule Display Name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
Data Access Rule for group 'users'
Default expression to use when no filter matches the query
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|'<> ]+$
Example:
true
Optional Data Access Rule Description
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\-\s]+$
Example:
Data Access Rule that defines restriction on 'users' group
List of filters that the Data Access Rule is composed of
Possible values: 0 ≤ number of items ≤ 4096
Data Access Rule details.
{
"default_expression": "<v1> foo == 'bar'",
"description": "Data Access Rule intended for testing",
"display_name": "Test Data Access Rule",
"filters": [
{
"entity_type": "logs",
"expression": "<v1> foo == 'bar'"
}
],
"id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
}
Data Access Rule ID.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
Data Access Rule Display Name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:Data Access Rule for group 'users'
Optional Data Access Rule Description.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\-\\s]+$/
Examples:Data Access Rule that defines restriction on 'users' group
List of filters that the Data Access Rule is composed of.
Possible values: 0 ≤ number of items ≤ 4096
- Filters
Filter's Entity Type.
Possible values: [
unspecified
,logs
]Examples:logs
Filter's Expression.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|'<> ]+$/
Examples:true
Default expression to use when no filter matches the query.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|'<> ]+$/
Examples:true
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "default_expression": "<v1> foo == 'bar'", "description": "Data Access Rule intended for testing", "display_name": "Test Data Access Rule", "filters": [ { "entity_type": "logs", "expression": "<v1> foo == 'bar'" } ], "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff" }
{ "default_expression": "<v1> foo == 'bar'", "description": "Data Access Rule intended for testing", "display_name": "Test Data Access Rule", "filters": [ { "entity_type": "logs", "expression": "<v1> foo == 'bar'" } ], "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Delete a Data Access Rule
Delete a Data Access Rule
Delete a Data Access Rule.
DELETE /v1/data_access_rules/{id}
(logs *LogsV0) DeleteDataAccessRule(deleteDataAccessRuleOptions *DeleteDataAccessRuleOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteDataAccessRuleWithContext(ctx context.Context, deleteDataAccessRuleOptions *DeleteDataAccessRuleOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteDataAccessRuleOptions
struct and set the fields to provide parameter values for the DeleteDataAccessRule
method.
Path Parameters
ID of Data Access Rule to be deleted
Possible values: length = 36, Value must match regular expression
^[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
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteDataAccessRule options.
ID of Data Access Rule to be deleted.
Possible values: length = 36, Value must match regular expression
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
Examples:3dc02998-0b50-4ea8-b68a-4779d716fa1f
curl -X DELETE --location --header "Authorization: Bearer ${iam_token}" "${base_url}/v1/data_access_rules/${id}"
deleteDataAccessRuleOptions := logsService.NewDeleteDataAccessRuleOptions( CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"), ) response, err := logsService.DeleteDataAccessRule(deleteDataAccessRuleOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteDataAccessRule(): %d\n", response.StatusCode) }
Response
Status Code
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
List all enrichments
List all enrichments
List all enrichments.
GET /v1/enrichments
(logs *LogsV0) GetEnrichments(getEnrichmentsOptions *GetEnrichmentsOptions) (result *EntrichmentCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) GetEnrichmentsWithContext(ctx context.Context, getEnrichmentsOptions *GetEnrichmentsOptions) (result *EntrichmentCollection, response *core.DetailedResponse, err error)
Request
No Request Parameters
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/enrichments"
getEnrichmentsOptions := logsService.NewGetEnrichmentsOptions() entrichmentCollection, response, err := logsService.GetEnrichments(getEnrichmentsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(entrichmentCollection, "", " ") fmt.Println(string(b))
Response
The enrichments collection
The enrichments
Possible values: 0 ≤ number of items ≤ 4096
The enrichments collection.
{
"enrichments": [
{
"enrichment_type": {
"geo_ip": {}
},
"field_name": "ip",
"id": 3
},
{
"enrichment_type": {
"geo_ip": {}
},
"field_name": "client_ip",
"id": 6
},
{
"enrichment_type": {
"suspicious_ip": {}
},
"field_name": "client_ip",
"id": 23
},
{
"enrichment_type": {
"custom_enrichment": {
"id": 17
}
},
"field_name": "phone_code",
"id": 24
}
]
}
The enrichments.
Possible values: 0 ≤ number of items ≤ 4096
- Enrichments
The enrichment ID.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
The enrichment field name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:sourceIPs
The enrichment type.
- EnrichmentType
The geo ip enrichment.
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "enrichments": [ { "enrichment_type": { "geo_ip": {} }, "field_name": "ip", "id": 3 }, { "enrichment_type": { "geo_ip": {} }, "field_name": "client_ip", "id": 6 }, { "enrichment_type": { "suspicious_ip": {} }, "field_name": "client_ip", "id": 23 }, { "enrichment_type": { "custom_enrichment": { "id": 17 } }, "field_name": "phone_code", "id": 24 } ] }
{ "enrichments": [ { "enrichment_type": { "geo_ip": {} }, "field_name": "ip", "id": 3 }, { "enrichment_type": { "geo_ip": {} }, "field_name": "client_ip", "id": 6 }, { "enrichment_type": { "suspicious_ip": {} }, "field_name": "client_ip", "id": 23 }, { "enrichment_type": { "custom_enrichment": { "id": 17 } }, "field_name": "phone_code", "id": 24 } ] }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Create an enrichment
Create an enrichment
Create an enrichment.
POST /v1/enrichments
(logs *LogsV0) CreateEnrichment(createEnrichmentOptions *CreateEnrichmentOptions) (result *Enrichment, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateEnrichmentWithContext(ctx context.Context, createEnrichmentOptions *CreateEnrichmentOptions) (result *Enrichment, response *core.DetailedResponse, err error)
Request
Instantiate the CreateEnrichmentOptions
struct and set the fields to provide parameter values for the CreateEnrichment
method.
The model use to create an enrichment
{
"enrichment_type": {
"geo_ip": {}
},
"field_name": "ip"
}
The name of the field to enrich
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
sourceIPs
The enrichment type
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateEnrichment options.
The name of the field to enrich.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:ip
The enrichment type.
- EnrichmentType
The geo ip enrichment.
curl -X POST --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "enrichment_type": { "geo_ip": {} }, "field_name": "ip" }' "${base_url}/v1/enrichments"
enrichmentV1GeoIpTypeEmptyModel := &logsv0.EnrichmentV1GeoIpTypeEmpty{ } enrichmentV1EnrichmentTypeModel := &logsv0.EnrichmentV1EnrichmentTypeTypeGeoIp{ GeoIp: enrichmentV1GeoIpTypeEmptyModel, } createEnrichmentOptions := logsService.NewCreateEnrichmentOptions( "ip", enrichmentV1EnrichmentTypeModel, ) enrichment, response, err := logsService.CreateEnrichment(createEnrichmentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(enrichment, "", " ") fmt.Println(string(b))
Response
The enrichments
The enrichment ID
Possible values: 0 ≤ value ≤ 4294967295
Example:
1
The enrichment field name
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$
Example:
sourceIPs
The enrichment type
The enrichments.
The enrichment ID.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
The enrichment field name.
Possible values: 1 ≤ length ≤ 4096, Value must match regular expression
/^[A-Za-z0-9_\\.,\\-\"{}()\\[\\]=!:#\/$|' ]+$/
Examples:sourceIPs
The enrichment type.
- EnrichmentType
The geo ip enrichment.
Status Code
Created
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Delete enrichments
Delete enrichments
Delete enrichments.
DELETE /v1/enrichments/{id}
(logs *LogsV0) RemoveEnrichments(removeEnrichmentsOptions *RemoveEnrichmentsOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) RemoveEnrichmentsWithContext(ctx context.Context, removeEnrichmentsOptions *RemoveEnrichmentsOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the RemoveEnrichmentsOptions
struct and set the fields to provide parameter values for the RemoveEnrichments
method.
Path Parameters
The enrichment ID
Possible values: 0 ≤ value ≤ 4294967295
Example:
1
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The RemoveEnrichments options.
The enrichment ID.
Possible values: 0 ≤ value ≤ 4294967295
Examples:1
curl -X DELETE --location --header "Authorization: Bearer ${iam_token}" "${base_url}/v1/enrichments/${id}"
removeEnrichmentsOptions := logsService.NewRemoveEnrichmentsOptions( int64(1), ) response, err := logsService.RemoveEnrichments(removeEnrichmentsOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from RemoveEnrichments(): %d\n", response.StatusCode) }
Response
Status Code
No Content
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Get data usage metrics export status
Get data usage metrics export status
Get data usage metrics export status.
GET /v1/data_usage
(logs *LogsV0) GetDataUsageMetricsExportStatus(getDataUsageMetricsExportStatusOptions *GetDataUsageMetricsExportStatusOptions) (result *DataUsageMetricsExportStatus, response *core.DetailedResponse, err error)
(logs *LogsV0) GetDataUsageMetricsExportStatusWithContext(ctx context.Context, getDataUsageMetricsExportStatusOptions *GetDataUsageMetricsExportStatusOptions) (result *DataUsageMetricsExportStatus, response *core.DetailedResponse, err error)
Request
No Request Parameters
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
No Request Parameters
curl -X GET --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" "${base_url}/v1/data_usage"
getDataUsageMetricsExportStatusOptions := logsService.NewGetDataUsageMetricsExportStatusOptions() dataUsageMetricsExportStatus, response, err := logsService.GetDataUsageMetricsExportStatus(getDataUsageMetricsExportStatusOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(dataUsageMetricsExportStatus, "", " ") fmt.Println(string(b))
Response
The data usage metrics export status
The "enabled" parameter for metrics export
Example:
true
The data usage metrics export status.
The "enabled" parameter for metrics export.
Examples:true
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
Update data usage metrics export status
Update data usage metrics export status
Update data usage metrics export status.
PUT /v1/data_usage
(logs *LogsV0) UpdateDataUsageMetricsExportStatus(updateDataUsageMetricsExportStatusOptions *UpdateDataUsageMetricsExportStatusOptions) (result *DataUsageMetricsExportStatus, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdateDataUsageMetricsExportStatusWithContext(ctx context.Context, updateDataUsageMetricsExportStatusOptions *UpdateDataUsageMetricsExportStatusOptions) (result *DataUsageMetricsExportStatus, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateDataUsageMetricsExportStatusOptions
struct and set the fields to provide parameter values for the UpdateDataUsageMetricsExportStatus
method.
The data usage metrics export status
The "enabled" parameter for metrics export
Example:
true
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The UpdateDataUsageMetricsExportStatus options.
The "enabled" parameter for metrics export.
Examples:true
curl -X PUT --location --header "Authorization: Bearer ${iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "enabled": true }' "${base_url}/v1/data_usage"
updateDataUsageMetricsExportStatusOptions := logsService.NewUpdateDataUsageMetricsExportStatusOptions( true, ) dataUsageMetricsExportStatus, response, err := logsService.UpdateDataUsageMetricsExportStatus(updateDataUsageMetricsExportStatusOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(dataUsageMetricsExportStatus, "", " ") fmt.Println(string(b))
Response
The data usage metrics export status
The "enabled" parameter for metrics export
Example:
true
The data usage metrics export status.
The "enabled" parameter for metrics export.
Examples:true
Status Code
OK
Bad Request
Unauthorized
Forbidden
Not Found
Unknown
Conflict
Too Many Requests
Internal Server Error
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "bad_request_or_unspecified", "message": "Bad request" } ], "status_code": 400, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthenticated", "message": "Unauthenticated" } ], "status_code": 401, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "unauthorized", "message": "Forbidden" } ], "status_code": 403, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "not_found", "message": "Not found" } ], "status_code": 404, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "deadline_exceeded", "message": "Request timeout" } ], "status_code": 408, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "conflict", "message": "Conflict, resource already exists" } ], "status_code": 409, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "resource_exhausted", "message": "Rate limit exceeded" } ], "status_code": 429, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }
{ "errors": [ { "code": "method_internal_error", "message": "Internal server error" } ], "status_code": 500, "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e" }