Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const eslintConfig = [
"pact/**",
"performance/report",
"logs-viewer/www",
"logs-viewer/dist",
],
},
...nextCoreWebVitals,
Expand Down
45 changes: 45 additions & 0 deletions logs-viewer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Splunk Logs Graph Viewer

A Chrome extension that renders Splunk logs as an interactive graph, making it easier to visualize log flows and session traces.

## Features
- **Interactive Graph**: Visualizes logs as nodes and edges.
- **Session Grouping**: Automatically groups logs by `sessionId`, `traceId`, or `requestId`.
- **Latency Tracking**: Shows latency between consecutive log entries.
- **Device Detection**: Identifies devices and platforms from user-agent headers in logs.
- **Log Inspection**: Click on nodes to view detailed log data.

## How to Build
To build the extension from source, ensure you have [Node.js](https://nodejs.org/) installed, then follow these steps:

1. **Install dependencies**:
```bash
npm install
```
2. **Build the project**:
```bash
npm run build
```
This will generate a `dist/` directory containing the compiled extension.

## How to Install (Chrome Extension)
1. Open Chrome and navigate to `chrome://extensions/`.
2. Enable **Developer mode** using the toggle in the top right corner.
3. Click the **Load unpacked** button.
4. Select the `logs-viewer/` folder.

## How to Use (Chrome)
1. Navigate to your Splunk instance (configured for `https://nhsdigital.splunkcloud.com/*`).
2. Perform a search that returns logs in the expected JSON format.
3. A **"Graph View [ Open ]"** button will appear on the page.
4. Click the button to generate and view the interactive graph.

## How to Run Locally (CLI)
If you have a log file in JSON format (downloaded from Splunk), you can process and view it locally without installing the extension:

1. **Prepare your logs**: Ensure you have a log file (e.g., `logs.json`).
2. **Process and start server**:
```bash
./process-and-view-cli.sh logs.json
```
3. **View the graph**: Open the URL displayed in the terminal ( `http://localhost:8080` ).
17 changes: 17 additions & 0 deletions logs-viewer/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"manifest_version": 3,
"name": "Splunk Logs Graph Viewer",
"version": "1.0.0",
"description": "Render Splunk logs as interactive graph",
"icons": {
"128": "public/icons/icon128.png"
},
"content_scripts": [
{
"matches": ["https://nhsdigital.splunkcloud.com/en-GB/app/nhse_vita_all_sh_all_viz/*"],
"js": ["dist/bundle.js"]
}
],
"permissions": ["scripting"],
"host_permissions": ["https://nhsdigital.splunkcloud.com/*"]
}
Loading
Loading