Skip to main content

JSON Viewer

Graytool's JSON Viewer lets you inspect, search, and copy log messages in a structured view.

Opening​

To open the JSON Viewer:

  1. Click the πŸ” message detail button on a log row
  2. On first open, a field selector is shown (if no defaultMessageField is set)
  3. After selecting a field, the JSON Viewer panel opens

Panel Structure​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Title [βœ•] [β–‘] β”‚ ← Header
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ [Field Selector β–Ό] [πŸ” Search...] [πŸ“‹ Copy]β”‚ ← Toolbar
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ { β”‚
β”‚ "userId": "12345", [⊞] [πŸ“‹] β”‚ ← JSON Tree
β”‚ "request": { [⊞] [πŸ“‹] β”‚
β”‚ "method": "POST", [⊞] [πŸ“‹] β”‚
β”‚ "path": "/api/login" [⊞] [πŸ“‹] β”‚
β”‚ }, β”‚
β”‚ "level": "ERROR" [⊞] [πŸ“‹] β”‚
β”‚ } β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ [Raw] [DevTools] [Code] β”‚ ← Tabs
β”‚ ───────────────────────────────── β”‚
β”‚ Tab content β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Features​

Syntax Highlighting​

JSON data is displayed with color coding:

ElementDark ThemeLight Theme
Keys#56B6C2 (cyan)#0066CC (blue)
Strings#98C379 (green)#22863A (dark green)
Numbers#D19A66 (orange)#B08800 (gold)
Booleans#D19A66#B08800
Null#A0A0A0 (gray)#6A737D (gray)

Search and Filter​

  • Type text in the toolbar search box
  • Matching keys and values are highlighted
  • Use ↑ / ↓ arrow keys to navigate between results
  • Current result is highlighted with the primary color

Row Actions​

Two buttons appear on hover for each JSON row:

ButtonFunction
⊞ FilterApplies field:value to the Graylog search bar
πŸ“‹ CopyCopies the value to clipboard

Filter button:

  • Finds Graylog's search editor
  • Adds a field:value format query
  • Clicks the search button to update results

Copy​

  • πŸ“‹ Copy All (toolbar) β€” Copies entire JSON to clipboard
  • πŸ“‹ Copy (row) β€” Copies a single value
  • A βœ“ Copied notification appears after copying

Fullscreen / Minimize​

  • β–‘ Maximize β€” Panel expands to full width
  • βœ• Close β€” Closes the panel

Tabs​

Raw Tab​

Displays raw JSON text in monospace font. Ideal for direct copying.

DevTools Tab​

Transformation tools for JSON text:

  • Escape β€” Escapes a JSON string
  • Unescape β€” Restores escaped text to original form

Useful for quickly fixing embedded JSON strings in log messages.

Code Tab​

Generates code snippets from JSON data in various languages:

Language/ToolDescription
curlcURL command
fetchJavaScript Fetch API
axiosAxios HTTP client
httpRaw HTTP request
phpPHP code
pythonPython requests
goGo net/http
javaJava HttpClient

Tab Behaviors​

  • Double-click β€” Collapse/expand tab area
  • Drag β€” Adjust tab height
  • Collapse threshold β€” Auto-collapses below 30px
  • State persists β€” Collapse state saved in localStorage

Field Selector​

When defaultMessageField is not set, a field selector modal is shown before opening the JSON viewer:

  • Available fields are listed with radio buttons
  • Each field shows a value preview (truncated to 80 characters)
  • "Save as default" option can be checked
  • Auto-selects if only one field is available

Keyboard Shortcuts​

ShortcutFunction
EscClose JSON viewer
/Focus search box
↑Previous search result
↓Next search result

Notifications​

Notifications appear in the bottom-right corner after actions like copy and filter:

  • Green β€” Successful operation (copy, filter)
  • Red β€” Error
  • Blue β€” Info
  • Yellow β€” Warning

Notifications auto-dismiss after 3.2 seconds.