---
title: "Search file contents in image"
method: GET
path: "/inspect/{image_uuid}/grep"
tags: ["inspect"]
---

# Search file contents in image

`GET /inspect/{image_uuid}/grep`

Regex content search inside the image's root filesystem, powered by ripgrep.

Symlinks are never followed during traversal, hidden files are searched,
`.gitignore`-style files inside the image are ignored, and binary files
(containing a NUL byte) are skipped. Rust regex syntax, linear-time matching.

## Path parameters

- `image_uuid` string, uuid, required — A UUID string

## Query parameters

- `pattern` string, required
- `path` string
- `glob` string
- `max_count` integer
- `max_total` integer
- `case` 'sensitive' | 'insensitive' | 'smart'

## Response `200`

OK

- GrepResult
  - `path` string, required — The path inside the image that was searched
  - `patterns` string[], required — The patterns that were searched for
  - `matches` GrepMatch[], required
    - `path` string, required — File path relative to the image rootfs
    - `line_number` integer, required — 1-based line number of the match
    - `absolute_offset` integer, required — Byte offset of the line from the start of the file
    - `line_text` string, required — The matching line, including the line terminator (truncated at 4096 bytes)
    - `line_bytes` integer, required — Real byte length of the matching line; greater than line_text length when the line was capped
    - `submatches` GrepSubmatch[], required
      - `text` string, required — The matched text
      - `start` integer, required — Byte offset of the match start within the line
      - `end` integer, required — Byte offset of the match end within the line
  - `truncated` boolean, required — True when max_total or the search deadline stopped the search early

## Other responses

- `400` — Bad Request - Invalid request parameters
- `401` — Unauthorized - Invalid or missing authentication credentials. Either the `Authorization` bearer token is missing or invalid, or the `Project` header is missing.
- `403` — Forbidden - Token does not have sufficient permissions
- `404` — Not Found - The path does not exist in the image or image does not exist

---

[API](https://skmtc.net/nebius/apis/nebius-openai-compatible-inference-api.md) · [All operations](https://skmtc.net/nebius/apis/nebius-openai-compatible-inference-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nebius/nebius-openai-compatible-inference-api/revisions/0fb323abba3c/schema)
