# getLogsCount

Get the total count of audit logs matching the specified criteria.

### Examples

{% tabs %}
{% tab title="GraphQL" %}

```graphql
query GetLogsCount($input: GetLogsInput) {
  getLogsCount(input: $input) {
    count
  }
}
```

**Variables**

This is an example input showing all available input fields. Only fields marked as required in the schema are mandatory.

```json
{
  "input": {
    "logTypes": ["Authentication"],
    "logNames": ["AddCredentials"],
    "userEmails": ["example"],
    "appNames": ["example"],
    "limit": 100,
    "skip": 0,
    "orderBy": {
      "field": "example",
      "direction": "ASC"
    },
    "dateRange": {
      "from": "1672531200000",
      "to": "1704067199000"
    }
  }
}
```

{% endtab %}

{% tab title="cURL" %}

```shell
curl -X POST \
https://api.cloud.ox.security/api/apollo-gateway \
-H 'Content-Type: application/json' \
-H 'Authorization: YOUR_API_TOKEN' \
-d '{
 "query": "query GetLogsCount($input: GetLogsInput) { getLogsCount(input: $input) { count } }",
 "variables": {
    "input": {
      "logTypes": ["Authentication"],
      "logNames": ["AddCredentials"],
      "userEmails": ["example"],
      "appNames": ["example"],
      "limit": 100,
      "skip": 0,
      "orderBy": {
        "field": "example",
        "direction": "ASC"
      },
      "dateRange": {
        "from": "1672531200000",
        "to": "1704067199000"
      }
    }
  }
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const query = 'query GetLogsCount($input: GetLogsInput) { getLogsCount(input: $input) { count } }';

fetch("https://api.cloud.ox.security/api/apollo-gateway", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_TOKEN"
  },
  body: JSON.stringify({
    query: query,
    // This is an example input showing all available input fields. Only fields marked as required in the schema are mandatory.
    variables: {
      input: {
        logTypes: ["Authentication"],
        logNames: ["AddCredentials"],
        userEmails: ["example"],
        appNames: ["example"],
        limit: 100,
        skip: 0,
        orderBy: {
          field: "example",
          direction: "ASC"
        },
        dateRange: {
          from: "1672531200000",
          to: "1704067199000"
        }
      }
    }
  })
})
.then(response => response.json())
.then(result => console.log(JSON.stringify(result, null, 2)))
.catch(error => console.error('Error:', error));
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

query = 'query GetLogsCount($input: GetLogsInput) { getLogsCount(input: $input) { count } }'

response = requests.post(
  "https://api.cloud.ox.security/api/apollo-gateway",
  headers={
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_TOKEN"
  },
  json={
    "query": query,
    # This is an example input showing all available input fields. Only fields marked as required in the schema are mandatory.
    "variables": {
      "input": {
        "logTypes": ["Authentication"],
        "logNames": ["AddCredentials"],
        "userEmails": ["example"],
        "appNames": ["example"],
        "limit": 100,
        "skip": 0,
        "orderBy": {
          "field": "example",
          "direction": "ASC"
        },
        "dateRange": {
          "from": "1672531200000",
          "to": "1704067199000"
        }
      }
    }
  }
)

if response.status_code == 200:
    result = response.json()
    print(result)
else:
    print(f"Error: {response.status_code}")
    print(response.text)
```

{% endtab %}
{% endtabs %}

### Arguments

You can use the following argument(s) to customize your `getLogsCount` query.

| Argument                                                                                           | Description                               | Supported fields                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------------------------------------------------------------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| input [`GetLogsInput`](/api-documentation/api-reference/api--audit/types/inputs/get-logs-input.md) | Filter parameters for counting audit logs | <p>logTypes <a href="/pages/rfl3NwyAJ7CYL4rEj3HD"><code>\[LogType!]</code></a><br>logNames <a href="/pages/3CVchiMy5sTNMkNYutTD"><code>\[LogName!]</code></a><br>userEmails <code>\[String!]</code><br>appNames <code>\[String!]</code><br>limit <code>Float</code><br>skip <code>Float</code><br>orderBy <a href="/pages/h6qTOkLOj0u35QBLGG0u"><code>LogOrderBy</code></a><br>dateRange <a href="/pages/RjMfxGKkUBK4A1RJJHeA"><code>LogDateRange</code></a></p> |

### Fields

Return type: [`AuditLogCount!`](/api-documentation/api-reference/api--audit/types/objects/audit-log-count.md)

You can use the following field(s) to specify what information your `getLogsCount` query will return. Please note that some fields may have their own subfields.

| Field         | Description                                | Supported fields |
| ------------- | ------------------------------------------ | ---------------- |
| count `Float` | Total number of matching audit log entries |                  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ox.security/api-documentation/api-reference/api--audit/queries/get-logs-count.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
