Repository navigation
docs(logs): Elasticsearch help examples that work on keyword fields - #124
Open
blue4209211 wants to merge 1 commit into
Open
blue4209211 wants to merge 1 commit into
blue4209211 wants to merge 1 commit into
Conversation
Nubi copies the logs query --help examples first. Both Elasticsearch
examples used {"match":...}, which on a keyword-mapped field (log on dev
account bda8ae12) compares the whole value and silently returns 0; Nubi
then spent dozens of calls finding out why. The examples now use a
case-insensitive wildcard, which works on keyword and text fields, and the
help says to check a field's Type (list-labels --fields-only) first.
Verified live: the old examples return 0 lines; the new counts example
returns 265 series summing to the exact total (170,084).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates the help text and example commands in cmd/logs_query.go for Elasticsearch queries. It adds a note explaining that matching on a keyword field compares the whole value, and updates the examples to use case-insensitive wildcard queries instead of match queries on the log field. There are no review comments, so we have no feedback to provide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nubi copies the
logs query --helpexamples first. Both Elasticsearch examples used{"match": ...}. On a field mapped askeyword(logon dev accountbda8ae12),matchcompares the whole value and silently returns 0. Nubi then spent dozens of calls finding out why: 49+ calls locally on v0.0.4, and 80+ on dev with the old nbctl.Changes
{"wildcard":{"log":{"value":"*error*","case_insensitive":true}}}, which works on keyword and text fields alike.nbctl logs list-labels --fields-only) before searching it, becausematchon a keyword field compares the whole value.Help text only; no behavior change.
Testing
make buildpasses (lint,go test -race ./..., build).bda8ae12, 6h window:total≥ 10,000);list-labels --fields-onlyshowslogaskeyword.🤖 Generated with Claude Code