---
title: "Search logs using LogQL queries"
method: POST
path: "/api/v1/k8s/logs/search/logql"
tags: ["K8s Logs"]
---

# Search logs using LogQL queries

`POST /api/v1/k8s/logs/search/logql`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/k8s/logs/search/logql`
- Auth: none declared

Search logs using Loki-style LogQL syntax

## Request body

- K8sLogsLogQLQuery
  - `direction` string: forward/backward
  - `end` string: End time
  - `labels` object: Additional label filters
  - `limit` integer: Result limit
  - `query` string: LogQL query: {app="web"} |= "error"
  - `start` string: Start time
  - `step` string: Step for aggregations

## Response `200`

OK

- K8sLogsK8sLogEntry[]
  - `app_name` string
  - `cluster_id` string
  - `container_name` string
  - `created_at` string
  - `fingerprint` string: Log fingerprint for deduplication
  - `id` string
  - `labels` object: Loki-inspired enhancements
  - `line_number` integer
  - `log_level` string
  - `message` string
  - `namespace` string
  - `org_id` string
  - `parsed` object: Parsed JSON/structured data
  - `pod_name` string
  - `stream` string: stdout/stderr
  - `timestamp` string
  - `user_id` string

---

[API](https://skmtc.dev/nife/apis/nife-io-swagger-api.md) - [All operations](https://skmtc.dev/nife/apis/nife-io-swagger-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nife/apis/nife-io-swagger-api/revisions/6e868dc62795?raw)
