> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GetLogQuery



## OpenAPI

````yaml /docs/api/openapi/logs_openapi.json post /core.v1.LogsService/GetLogQuery
openapi: 3.1.0
info:
  title: core.v1.LogsService
  version: 0.0.1
servers:
  - url: https://api.joinformal.com
    description: Production API
security: []
tags:
  - name: core.v1.LogsService
paths:
  /core.v1.LogsService/GetLogQuery:
    post:
      tags:
        - core.v1.LogsService
      summary: GetLogQuery
      operationId: core.v1.LogsService.GetLogQuery
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/core.v1.GetLogQueryRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.v1.GetLogQueryResponse'
        '400':
          description: Bad Request - Invalid request parameters or body
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: invalid_request
                  message:
                    type: string
                    example: Invalid request parameters
                  details:
                    type: object
        '401':
          description: Unauthorized - Missing or invalid authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: unauthorized
                  message:
                    type: string
                    example: Authentication required
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: forbidden
                  message:
                    type: string
                    example: Insufficient permissions to perform this action
        '404':
          description: Not Found - Resource does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: not_found
                  message:
                    type: string
                    example: Resource not found
        '500':
          description: Internal Server Error - An error occurred processing the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: internal_error
                  message:
                    type: string
                    example: An internal error occurred
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://api.joinformal.com/core.v1.LogsService/GetLogQuery" \
              -H "X-API-KEY: YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "example": "value"
              }'
        - lang: javascript
          label: JavaScript (fetch)
          source: >-
            fetch("https://api.joinformal.com/core.v1.LogsService/GetLogQuery",
            {
              method: "POST",
              headers: {
                "X-API-KEY": "YOUR_API_KEY",
                "Content-Type": "application/json"
              },
              body: JSON.stringify({
                example: "value"
              })
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: python
          label: Python
          source: |-
            import requests

            url = "https://api.joinformal.com/core.v1.LogsService/GetLogQuery"
            headers = {
                "X-API-KEY": "YOUR_API_KEY",
                "Content-Type": "application/json"
            }
            data = {
                "example": "value"
            }

            response = requests.post(url, headers=headers, json=data)
            print(response.json())
        - lang: go
          label: Go
          source: |-
            package main

            import (
                "bytes"
                "encoding/json"
                "fmt"
                "io"
                "net/http"
            )

            func main() {
                url := "https://api.joinformal.com/core.v1.LogsService/GetLogQuery"

                body := map[string]string{
                    "example": "value",
                }

                jsonData, _ := json.Marshal(body)

                req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
                req.Header.Set("X-API-KEY", "YOUR_API_KEY")
                req.Header.Set("Content-Type", "application/json")

                client := &http.Client{}
                resp, err := client.Do(req)
                if err != nil {
                    panic(err)
                }
                defer resp.Body.Close()

                responseBody, _ := io.ReadAll(resp.Body)
                fmt.Println(string(responseBody))
            }
components:
  schemas:
    core.v1.GetLogQueryRequest:
      type: object
      properties:
        id:
          type: string
          title: id
          minLength: 1
      title: GetLogQueryRequest
      additionalProperties: false
    core.v1.GetLogQueryResponse:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/core.v1.LogQueryMetadata'
          title: metadata
      title: GetLogQueryResponse
      additionalProperties: false
    core.v1.LogQueryMetadata:
      type: object
      properties:
        id:
          type: string
          title: id
          minLength: 1
        name:
          type: string
          title: name
          minLength: 1
        createdBy:
          type: string
          title: created_by
          minLength: 1
        query:
          $ref: '#/components/schemas/core.v1.SavedLogQuery'
          title: query
      title: LogQueryMetadata
      additionalProperties: false
    core.v1.SavedLogQuery:
      type: object
      properties:
        query:
          type: string
          title: query
        filters:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.SavedLogQueryFilter'
          title: filters
        relativeTime:
          type:
            - integer
            - string
          title: relativeTime
          format: int64
        histogramGroupByFields:
          type: array
          items:
            type: string
            maxItems: 3
          title: histogram_group_by_fields
          maxItems: 3
        metricAggregation:
          $ref: '#/components/schemas/core.v1.MetricAggregation'
          title: metric_aggregation
      title: SavedLogQuery
      additionalProperties: false
    core.v1.SavedLogQueryFilter:
      type: object
      properties:
        name:
          type: string
          title: name
        values:
          type: array
          items:
            type: string
          title: values
      title: SavedLogQueryFilter
      additionalProperties: false
    core.v1.MetricAggregation:
      type: object
      properties:
        field:
          type: string
          title: field
          minLength: 1
        aggType:
          type: string
          title: agg_type
          enum:
            - value_count
            - avg
            - sum
            - min
            - max
            - p90
            - p95
            - p99
      title: MetricAggregation
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key authentication. Get your API key from the Formal console.

````