using Auth0.ManagementApi;
using System.Threading.Tasks;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.LogStreams.CreateAsync(
new CreateLogStreamHttpRequestBody {
Type = LogStreamHttpEnum.Http,
Sink = new LogStreamHttpSink {
HttpEndpoint = "httpEndpoint"
}
}
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.CreateLogStreamRequestContent{
CreateLogStreamHttpRequestBody: &management.CreateLogStreamHttpRequestBody{
Type: management.LogStreamHttpEnum(
"http",
),
Sink: &management.LogStreamHttpSink{
HttpEndpoint: "httpEndpoint",
},
},
}
mgmt.LogStreams.Create(
context.TODO(),
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.CreateLogStreamHttpRequestBody;
import com.auth0.client.mgmt.types.CreateLogStreamRequestContent;
import com.auth0.client.mgmt.types.LogStreamHttpEnum;
import com.auth0.client.mgmt.types.LogStreamHttpSink;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.logStreams().create(
CreateLogStreamRequestContent.of(
CreateLogStreamHttpRequestBody
.builder()
.type(LogStreamHttpEnum.HTTP)
.sink(
LogStreamHttpSink
.builder()
.httpEndpoint("httpEndpoint")
.build()
)
.build()
)
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Types\CreateLogStreamHttpRequestBody;
use Auth0\SDK\API\Management\Types\LogStreamHttpEnum;
use Auth0\SDK\API\Management\Types\LogStreamHttpSink;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->logStreams->create(
new CreateLogStreamHttpRequestBody([
'type' => LogStreamHttpEnum::Http->value,
'sink' => new LogStreamHttpSink([
'httpEndpoint' => 'httpEndpoint',
]),
]),
);
from auth0.management import ManagementClient, CreateLogStreamHttpRequestBody, LogStreamHttpSink
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.log_streams.create(
request=CreateLogStreamHttpRequestBody(
type="http",
sink=LogStreamHttpSink(
http_endpoint="httpEndpoint",
),
),
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.log_streams.create(
type: "http",
sink: {
http_endpoint: "httpEndpoint"
}
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.logStreams.create({
type: "http",
sink: {
httpEndpoint: "httpEndpoint",
},
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.logStreams.create({
type: "http",
sink: {
httpEndpoint: "httpEndpoint",
},
});
}
main();
curl --request POST \
--url https://{tenantDomain}/api/v2/log-streams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "http",
"sink": {
"httpEndpoint": "<string>",
"httpAuthorization": "<string>",
"httpContentType": "<string>",
"httpCustomHeaders": [
{
"header": "<string>",
"value": "<string>"
}
]
},
"name": "<string>",
"isPriority": true,
"filters": [
{
"type": "category"
}
],
"startFrom": "2021-03-01T19:57:29.532Z"
}
'{
"id": "<string>",
"name": "<string>",
"status": "active",
"type": "http",
"isPriority": true,
"filters": [
{
"type": "category",
"name": "auth.login.fail"
}
],
"pii_config": {
"log_fields": [
"first_name"
],
"method": "mask",
"algorithm": "xxhash"
},
"sink": {
"httpEndpoint": "<string>",
"httpAuthorization": "<string>",
"httpContentFormat": "JSONARRAY",
"httpContentType": "<string>",
"httpCustomHeaders": [
{
"header": "<string>",
"value": "<string>"
}
]
}
}Create a log stream
Create a log stream.
Log Stream Types
The type of log stream being created determines the properties required in the sink payload.
HTTP Stream
For an http Stream, the sink properties are listed in the payload below.
Request:
{
"name": "string",
"type": "http",
"sink": {
"httpEndpoint": "string",
"httpContentType": "string",
"httpContentFormat": "JSONLINES|JSONARRAY",
"httpAuthorization": "string"
}
}
Response:
{
"id": "string",
"name": "string",
"type": "http",
"status": "active",
"sink": {
"httpEndpoint": "string",
"httpContentType": "string",
"httpContentFormat": "JSONLINES|JSONARRAY",
"httpAuthorization": "string"
}
}
Amazon EventBridge Stream
For an eventbridge Stream, the sink properties are listed in the payload below.
Request:
{
"name": "string",
"type": "eventbridge",
"sink": {
"awsRegion": "string",
"awsAccountId": "string"
}
}
The response will include an additional field awsPartnerEventSource in the sink:
Response:
{
"id": "string",
"name": "string",
"type": "eventbridge",
"status": "active",
"sink": {
"awsAccountId": "string",
"awsRegion": "string",
"awsPartnerEventSource": "string"
}
}
Azure Event Grid Stream
For an Azure Event Grid Stream, the sink properties are listed in the payload below.
Request:
{
"name": "string",
"type": "eventgrid",
"sink": {
"azureSubscriptionId": "string",
"azureResourceGroup": "string",
"azureRegion": "string"
}
}
Response:
{
"id": "string",
"name": "string",
"type": "http",
"status": "active",
"sink": {
"azureSubscriptionId": "string",
"azureResourceGroup": "string",
"azureRegion": "string",
"azurePartnerTopic": "string"
}
}
Datadog Stream
For a Datadog Stream, the sink properties are listed in the payload below.
Request:
{
"name": "string",
"type": "datadog",
"sink": {
"datadogRegion": "string",
"datadogApiKey": "string"
}
}
Response:
{
"id": "string",
"name": "string",
"type": "datadog",
"status": "active",
"sink": {
"datadogRegion": "string",
"datadogApiKey": "string"
}
}
Splunk Stream
For a Splunk Stream, the sink properties are listed in the payload below.
Request:
{
"name": "string",
"type": "splunk",
"sink": {
"splunkDomain": "string",
"splunkToken": "string",
"splunkPort": "string",
"splunkSecure": "boolean"
}
}
Response:
{
"id": "string",
"name": "string",
"type": "splunk",
"status": "active",
"sink": {
"splunkDomain": "string",
"splunkToken": "string",
"splunkPort": "string",
"splunkSecure": "boolean"
}
}
Sumo Logic Stream
For a Sumo Logic Stream, the sink properties are listed in the payload below.
Request:
{
"name": "string",
"type": "sumo",
"sink": {
"sumoSourceAddress": "string"
}
}
Response:
{
"id": "string",
"name": "string",
"type": "sumo",
"status": "active",
"sink": {
"sumoSourceAddress": "string"
}
}
using Auth0.ManagementApi;
using System.Threading.Tasks;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.LogStreams.CreateAsync(
new CreateLogStreamHttpRequestBody {
Type = LogStreamHttpEnum.Http,
Sink = new LogStreamHttpSink {
HttpEndpoint = "httpEndpoint"
}
}
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.CreateLogStreamRequestContent{
CreateLogStreamHttpRequestBody: &management.CreateLogStreamHttpRequestBody{
Type: management.LogStreamHttpEnum(
"http",
),
Sink: &management.LogStreamHttpSink{
HttpEndpoint: "httpEndpoint",
},
},
}
mgmt.LogStreams.Create(
context.TODO(),
request,
)
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.CreateLogStreamHttpRequestBody;
import com.auth0.client.mgmt.types.CreateLogStreamRequestContent;
import com.auth0.client.mgmt.types.LogStreamHttpEnum;
import com.auth0.client.mgmt.types.LogStreamHttpSink;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.logStreams().create(
CreateLogStreamRequestContent.of(
CreateLogStreamHttpRequestBody
.builder()
.type(LogStreamHttpEnum.HTTP)
.sink(
LogStreamHttpSink
.builder()
.httpEndpoint("httpEndpoint")
.build()
)
.build()
)
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Types\CreateLogStreamHttpRequestBody;
use Auth0\SDK\API\Management\Types\LogStreamHttpEnum;
use Auth0\SDK\API\Management\Types\LogStreamHttpSink;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->logStreams->create(
new CreateLogStreamHttpRequestBody([
'type' => LogStreamHttpEnum::Http->value,
'sink' => new LogStreamHttpSink([
'httpEndpoint' => 'httpEndpoint',
]),
]),
);
from auth0.management import ManagementClient, CreateLogStreamHttpRequestBody, LogStreamHttpSink
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.log_streams.create(
request=CreateLogStreamHttpRequestBody(
type="http",
sink=LogStreamHttpSink(
http_endpoint="httpEndpoint",
),
),
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.log_streams.create(
type: "http",
sink: {
http_endpoint: "httpEndpoint"
}
)
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.logStreams.create({
type: "http",
sink: {
httpEndpoint: "httpEndpoint",
},
});
}
main();
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.logStreams.create({
type: "http",
sink: {
httpEndpoint: "httpEndpoint",
},
});
}
main();
curl --request POST \
--url https://{tenantDomain}/api/v2/log-streams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "http",
"sink": {
"httpEndpoint": "<string>",
"httpAuthorization": "<string>",
"httpContentType": "<string>",
"httpCustomHeaders": [
{
"header": "<string>",
"value": "<string>"
}
]
},
"name": "<string>",
"isPriority": true,
"filters": [
{
"type": "category"
}
],
"startFrom": "2021-03-01T19:57:29.532Z"
}
'{
"id": "<string>",
"name": "<string>",
"status": "active",
"type": "http",
"isPriority": true,
"filters": [
{
"type": "category",
"name": "auth.login.fail"
}
],
"pii_config": {
"log_fields": [
"first_name"
],
"method": "mask",
"algorithm": "xxhash"
},
"sink": {
"httpEndpoint": "<string>",
"httpAuthorization": "<string>",
"httpContentFormat": "JSONARRAY",
"httpContentType": "<string>",
"httpCustomHeaders": [
{
"header": "<string>",
"value": "<string>"
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
http Show child attributes
Show child attributes
log stream name
True for priority log streams, false for non-priority
Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The optional datetime (ISO 8601) to start streaming logs from
Response
Log stream created
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
The id of the log stream
log stream name
The status of the log stream. Possible values: active, paused, suspended
active, paused, suspended http True for priority log streams, false for non-priority
Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes