Skip to content

Add logs link command for log viewer deep links#85

Merged
piekstra merged 1 commit intomainfrom
piekstra/logs-link
Mar 12, 2026
Merged

Add logs link command for log viewer deep links#85
piekstra merged 1 commit intomainfrom
piekstra/logs-link

Conversation

@piekstra
Copy link
Copy Markdown
Collaborator

Summary

  • Added nrq logs link "<filter>" command that generates New Relic log viewer deep links from Lucene filter queries
  • Added BuildLogDeepLink() function alongside existing BuildNRQLDeepLink() and BuildEntityDeepLink()
  • Added tests for the new deep link builder

Usage

# Link to error logs for a service
nrq logs link 'entity.name:"prd-use1-monitapp-user-api-service" level:"ERROR"'

# Link to logs from multiple services
nrq logs link '(entity.name:"svc-a" OR entity.name:"svc-b") level:"ERROR"'

# Link to logs matching a keyword
nrq logs link 'message:"*timeout*"'

This complements nrq nrql --link (query builder deep links) and nrq entities search --link (entity redirect links).

Test plan

  • go build ./... passes
  • go test ./... passes
  • Smoke tested: nrq logs link '...' produces valid URL

- Add `nrq logs link` command for NR log viewer deep links
- Add --since/--until time range flags to logs link and entities search
- Extract Build*DeepLink functions into internal/deeplink package
- Add url.PathEscape to BuildEntityDeepLink for base64 GUIDs
- Add shared ParseTimeRange helper to reduce duplication
- Gate time range parsing behind --link flag in entities search
@piekstra piekstra force-pushed the piekstra/logs-link branch from 097de0e to daf95fa Compare March 12, 2026 14:38
@piekstra piekstra merged commit 74580e9 into main Mar 12, 2026
@piekstra piekstra deleted the piekstra/logs-link branch March 12, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant