# memory: instinct-sqlite-iso-t-defeats-time-filter
SQLiteでstarted_at('...T...Z')をdatetime('now','-60 minutes')と直接比較すると文字列比較になり全件が窓に入る。正しい形はdatetime(replace(replace(started_at,'T',' '),'Z','')) > datetime('now','-60 minutes')。窓の件数が全件と一致していないか確認する。agentdのruns/status --jsonはトップレベルがlistで、job列はjob。
## ポイント
- SQLiteでstarted_atとdatetime('now','-60 minutes')を直接比較すると文字列比較になる
- 正しい形はdatetime(replace(replace(started_at,'T',' '),'Z','')) > datetime('now','-60 minutes')
- 窓の件数が全件と一致していないか確認する
- agentdのruns/status --jsonはトップレベルがlist
- agentdのjob列はjob
## 関連ページ
[[instinct-timestampless-log-tail-misreads-old-lines]] [[instinct-empty-count-reads-as-zero-in-bash]] [[instinct-agentd-silence-detection-ignores-logs]]
## 関連概念(未作成)
`SQLite文字列比較` `agentdトップレベルlist` `agentd job列`
memory: instinct-sqlite-iso-t-defeats-time-filter