Passer au contenu principal
GET
/
logs
TypeScript
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.logs.list({
        page: 1,
        perPage: 1,
        sort: "sort",
        fields: "fields",
        includeFields: true,
        includeTotals: true,
        q: "q",
    });
}
main();
[
  {
    "date": "2016-02-23T19:57:29.532Z",
    "type": "sapi",
    "description": "<string>",
    "connection": "<string>",
    "connection_id": "<string>",
    "client_id": "AaiyAPdpYdesoKnqjj8HJqRn4T5titww",
    "client_name": "My application Name",
    "ip": "190.257.209.19",
    "hostname": "190.257.209.19",
    "user_id": "auth0|56c75c4e42b6359e98374bc2",
    "user_name": "<string>",
    "audience": "<string>",
    "scope": "",
    "strategy": "<string>",
    "strategy_type": "<string>",
    "log_id": "<string>",
    "isMobile": true,
    "details": {},
    "user_agent": "<string>",
    "security_context": {
      "ja3": "<string>",
      "ja4": "<string>"
    },
    "location_info": {
      "country_code": "<string>",
      "country_code3": "<string>",
      "country_name": "<string>",
      "city_name": "<string>",
      "latitude": 123,
      "longitude": 123,
      "time_zone": "<string>",
      "continent_code": "<string>"
    }
  }
]

Autorisations

Authorization
string
header
requis

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

Paramètres de requête

page
integer

Page index of the results to return. First page is 0.

Plage requise: x >= 0
per_page
integer

Number of results per page. Paging is disabled if parameter not sent. Default: 50. Max value: 100

Plage requise: 0 <= x <= 100
sort
string

Field to use for sorting appended with :1 for ascending and :-1 for descending. e.g. date:-1

Pattern: ^((date)|(connection)|(client_id)|(client_name)|(ip)|(user_id)|(user_name)|(description)|(user_agent)|(type)|(details)|(strategy)|(strategy_type))\:(1|-1)$
fields
string

Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields.

Pattern: ^((date)|(connection)|(client_id)|(client_name)|(ip)|(user_id)|(user_name)|(description)|(user_agent)|(type)|(details)|(strategy)|(strategy_type))(,((date)|(connection)|(client_id)|(client_name)|(ip)|(user_id)|(user_name)|(description)|(user_agent)|(type)|(details)|(strategy)|(strategy_type)))*$
include_fields
boolean

Whether specified fields are to be included (true) or excluded (false)

include_totals
boolean

Return results as an array when false (default). Return results inside an object that also contains a total result count when true.

from
string

Log Event Id from which to start selection from.

take
integer

Number of entries to retrieve when using the from parameter. Default 50, max 100

Retrieves logs that match the specified search criteria. This parameter can be combined with all the others in the /api/logs endpoint but is specified separately for clarity. If no fields are provided a case insensitive 'starts with' search is performed on all of the following fields: client_name, connection, user_name. Otherwise, you can specify multiple fields and specify the search using the %field%:%search%, for example: application:node user:"John@contoso.com". Values specified without quotes are matched using a case insensitive 'starts with' search. If quotes are used a case insensitve exact search is used. If multiple fields are used, the AND operator is used to join the clauses.

Réponse

Logs successfully retrieved.

date
défaut:2016-02-23T19:57:29.532Z

Date when the event occurred in ISO 8601 format.

type
string
défaut:sapi

Type of event.

description
string | null

Description of this event.

connection
string

Name of the connection the event relates to.

connection_id
string

ID of the connection the event relates to.

client_id
string
défaut:AaiyAPdpYdesoKnqjj8HJqRn4T5titww

ID of the client (application).

client_name
string
défaut:My application Name

Name of the client (application).

ip
string
défaut:190.257.209.19

IP address of the log event source.

hostname
string
défaut:190.257.209.19

Hostname the event applies to.

user_id
string
défaut:auth0|56c75c4e42b6359e98374bc2

ID of the user involved in the event.

user_name
string

Name of the user involved in the event.

audience
string

API audience the event applies to.

scope
string
défaut:""

Scope permissions applied to the event.

strategy
string

Name of the strategy involved in the event.

strategy_type
string

Type of strategy involved in the event.

log_id
string

Unique ID of the event.

isMobile
boolean

Whether the client was a mobile device (true) or desktop/laptop/server (false).

details
object

Additional useful details about this event (structure is dependent upon event type).

user_agent
string

User agent string from the client device that caused the event.

security_context
object

Information about security-related signals.

location_info
object

Information about the location that triggered this event based on the ip.