---
yatl_version: 1
title: Implement --where host filtering
id: g5038fhj
created: 2026-01-26T04:58:49.317671Z
updated: 2026-01-27T19:27:18.836235610Z
author: Brian McCallister
priority: high
tags:
- cli
- hosts
blocked_by:
- d8kq9asx
- hqxt0dwn
---

Filter hosts using `--where` clause:

Syntax: `--where SELECTOR=VALUE` or `--where SELECTOR=/REGEX/`

For tabular data:
- `--where 2=web` → column 2 equals "web" (1-indexed)
- `--where 2=/^web/` → column 2 matches regex

For JSON/YAML:
- `--where /role=web` → json-pointer /role equals "web"
- `--where /tags/0=/prod/` → first tag matches regex

Add `regex` crate to Cargo.toml.

```rust
fn filter_hosts(hosts: Vec<Host>, where_clause: &str) -> Vec<Host>
```

---
# Log: 2026-01-26T04:58:49Z Brian McCallister

Created task.

---
# Log: 2026-01-26T04:59:23Z Brian McCallister

Added blocker: d8kq9asx

---
# Log: 2026-01-26T04:59:23Z Brian McCallister

Added blocker: hqxt0dwn

---
# Log: 2026-01-27T19:27:18Z Brian McCallister

Closed: No longer needed: --where filtering was for JSON/YAML/tabular formats. We're only using tagged list format with tag filtering (already implemented via :tag syntax)
