# Logz.io Connection https://api-docs.lumar.io/docs/graphql/logzio-connection The following guide shows you how to manage Logz.io connections in your Lumar account. Logz.io connections allow Lumar to import log data for log file analysis reports. ## Creating a Logz.io connection To create a connection, provide a label and your Logz.io API token: ```graphql mutation CreateLogzioConnection($input: CreateLogzioConnectionInput!) { createLogzioConnection(input: $input) { logzioConnection { id label isWorking } } } ``` **Variables:** ```json { "input": { "label": "Production Logz.io", "token": "your-logzio-api-token" } } ``` **Response:** ```json { "data": { "createLogzioConnection": { "logzioConnection": { "id": "TjAxOExvZ3ppb0Nvbm5lY3Rpb24x", "label": "Production Logz.io", "isWorking": true } } } } ``` ## Querying connections Retrieve all Logz.io connections for an account: ```graphql query GetLogzioConnections { me { logzioConnections(first: 10) { nodes { id label isWorking createdAt createdByUser { id username } } totalCount } } } ``` **Variables:** ```json {} ``` **Response:** ```json { "data": { "me": { "logzioConnections": { "nodes": [ { "id": "TjAxOExvZ3ppb0Nvbm5lY3Rpb24x", "label": "Production Logz.io", "isWorking": true, "createdAt": "2025-01-10T08:00:00.000Z", "createdByUser": { "id": "TjAwOFVzZXIxMjM", "username": "admin@example.com" } } ], "totalCount": 1 } } } } ``` The `isWorking` field indicates whether the connection is currently functional. If it is `false`, the API token may be invalid or expired. ## Updating a connection Update the label or token of an existing connection: ```graphql mutation UpdateLogzioConnection($input: UpdateLogzioConnectionInput!) { updateLogzioConnection(input: $input) { logzioConnection { id label isWorking } } } ``` **Variables:** ```json { "input": { "logzioConnectionId": "TjAxOExvZ3ppb0Nvbm5lY3Rpb24x", "label": "Updated Logz.io Connection" } } ``` **Response:** ```json { "data": { "updateLogzioConnection": { "logzioConnection": { "id": "TjAxOExvZ3ppb0Nvbm5lY3Rpb24x", "label": "Updated Logz.io Connection", "isWorking": true } } } } ``` ## Deleting a connection Remove a Logz.io connection when it is no longer needed: ```graphql mutation DeleteLogzioConnection($input: DeleteLogzioConnectionInput!) { deleteLogzioConnection(input: $input) { logzioConnection { id } } } ``` **Variables:** ```json { "input": { "logzioConnectionId": "TjAxOExvZ3ppb0Nvbm5lY3Rpb24x" } } ``` **Response:** ```json { "data": { "deleteLogzioConnection": { "logzioConnection": { "id": "TjAxOExvZ3ppb0Nvbm5lY3Rpb24x" } } } } ``` ## Project queries After creating a connection, you can set up project-level queries using `createLogzioProjectQuery` to define which log data Lumar should fetch for a specific project. Project queries allow you to configure: - `baseUrl` -- the base URL to match in log entries. - `dateRange` -- the number of days of log data to import. - User agent regex patterns for desktop, mobile, and AI bot detection. See [`CreateLogzioProjectQueryInput`](/docs/schema/inputs/create-logzio-project-query-input.md) for the full list of configuration options.