メインコンテンツへスキップ
POST
https://{tenantDomain}/api/v2
/
log-streams
Go
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &management.CreateLogStreamRequestContent{
        CreateLogStreamHttpRequestBody: &management.CreateLogStreamHttpRequestBody{
            Type: management.LogStreamHttpEnum(
                "http",
            ),
            Sink: &management.LogStreamHttpSink{
                HttpEndpoint: "httpEndpoint",
            },
        },
    }
    client.LogStreams.Create(
        context.TODO(),
        request,
    )
}
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.logStreams.create({
type: "http",
sink: {
httpEndpoint: "httpEndpoint",
},
});
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
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"
}
'
import requests

url = "https://{tenantDomain}/api/v2/log-streams"

payload = {
"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"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/log-streams",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/log-streams")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"http\",\n \"sink\": {\n \"httpEndpoint\": \"<string>\",\n \"httpAuthorization\": \"<string>\",\n \"httpContentType\": \"<string>\",\n \"httpCustomHeaders\": [\n {\n \"header\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"name\": \"<string>\",\n \"isPriority\": true,\n \"filters\": [\n {\n \"type\": \"category\"\n }\n ],\n \"startFrom\": \"2021-03-01T19:57:29.532Z\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/log-streams")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"http\",\n \"sink\": {\n \"httpEndpoint\": \"<string>\",\n \"httpAuthorization\": \"<string>\",\n \"httpContentType\": \"<string>\",\n \"httpCustomHeaders\": [\n {\n \"header\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"name\": \"<string>\",\n \"isPriority\": true,\n \"filters\": [\n {\n \"type\": \"category\"\n }\n ],\n \"startFrom\": \"2021-03-01T19:57:29.532Z\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "name": "<string>",
  "type": "http",
  "isPriority": true,
  "filters": [
    {
      "type": "category"
    }
  ],
  "pii_config": {
    "log_fields": [],
    "algorithm": "xxhash"
  },
  "sink": {
    "httpEndpoint": "<string>",
    "httpAuthorization": "<string>",
    "httpContentType": "<string>",
    "httpCustomHeaders": [
      {
        "header": "<string>",
        "value": "<string>"
      }
    ]
  }
}

承認

Authorization
string
header
必須

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

ボディ

type
enum<string>
必須
利用可能なオプション:
http
sink
object
必須
name
string

log stream name

isPriority
boolean

True for priority log streams, false for non-priority

filters
object[]

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

pii_config
object
startFrom
string
デフォルト:2021-03-01T19:57:29.532Z

The optional datetime (ISO 8601) to start streaming logs from

レスポンス

Log stream created

id
string<log-stream-id>

The id of the log stream

name
string

log stream name

status
enum<string>

The status of the log stream. Possible values: active, paused, suspended

利用可能なオプション:
active,
paused,
suspended
type
enum<string>
利用可能なオプション:
http
isPriority
boolean

True for priority log streams, false for non-priority

filters
object[]

Only logs events matching these filters will be delivered by the stream. If omitted or empty, all events will be delivered.

pii_config
object
sink
object