Comments (5)
I notice also that the newest message in the list is at the bottom, which isn't the same as the screen shot in the README.md (where the newest message seems to be inserted at the top of the list)
from cli-dashboard.
Further updates (for anyone coming along behind me). I've found the following:
- The version of this tool in the npm repository (sorry of this is incorrect terminology) seems to be different than the latest version in this repo, which I found when capturing the API calls and seeing that the ordering requested was ascending, despite all the files in this repository indicating a descending order;
- The npm version does not seem to work for me (at least not in Docker),per earlier comment the graphs plot but the log messages are not updated, and the log messages that do appear are in the wrong order;
- Installing the latest version of this repository resolves some of the problems (e.g. installation from my fork using command
npm install github:jjo93sa/cli-dashboard -g
), namely that log messages update, but the last message in the list (at the bottom) is several messages behind real time. I suspect this is because of the way the messages are being logged in thehandler.js
functionupdateMessagesList
using this callmessageList.setItems(items)
; - There seems to be quite a lot of interplay between the size of the
messageList
buffer and the number of events retrieved from the Graylog API via thebatch
size. Making the event count < buffer results in the most up-to-date message being shown at the bottom of the log list, albeit not at the bottom of the pane. I think this and point (3) are both due to thesetItems(items)
call, which bypasses the Log widget scroll to end step; - I've tried adding the scroll to end step from the blessed-contrib Log widget:
scrollTo(this.logLines.length)
but whilst it causes the display to update, it flickers too much for my liking; - My best result has been to modify
handlers.js
thus:
updateMessagesList(messages) {
const messageList = ui.getWidget('messageList');
const items = messages
.sort((message1, message2) => new Date(message1.timestamp) - new Date(message2.timestamp))
.map((message) => `${moment(message.timestamp).format()} - ${message.message}`);
let old_items = messageList.logLines;
let difference = items.filter(x => !old_items.includes(x));
difference.forEach(item => messageList.log(item));
},
Which I think (a) orders the message list from the Graylog API, (b) gets the current message list from the messageList Log widget (c) takes the difference between those two arrays and (d) iteratively adds the new log messages to the display. However, I don't know if (b) is working and I don't know JS. Even so, it seems necessary to change the following parameter in Graylog-dashboard.js
:
.describe('batch', 'events per request')
.default('batch','30')
such that the batch size is smaller than the buffer in the Log widget (set to 50). Without this step, occasionally old log messages appear again in the window.
My intention is to push a version of my files to my forked repository here. I will also publish the Dockerfile here
from cli-dashboard.
Nice work on the above, it now seems to be logging correctly for me..
from cli-dashboard.
@jonmelia - that's great. Could you please comment on which version you're running successfully?
from cli-dashboard.
@jonmelia - that's great. Could you please comment on which version you're running successfully?
I'm using your fork jjo93sa. Because we get so many messages it's difficult to see how far behind real-time they are, but for our purposes this isn't much of an issue as long as we can see them rotating in near realtime. The graylog-labs version just kept freezing and wouldn't update some streams
from cli-dashboard.
Related Issues (20)
- Error 404 with server v1.3.3 HOT 1
- No guide for how to configure output for graylog-cli HOT 1
- Could not get stream throughput HOT 10
- https HOT 3
- graylog2 2.0.2 HOT 4
- Could not get stream throughput. Error: HTTP 404 HOT 1
- Alternatives for storing the passwords HOT 3
- Display errors in a separate window
- Update npm version to latest release HOT 5
- New version does not poll for stream throughput with new API HOT 6
- Migrate to react-blessed?
- Unexpected token HOT 5
- Could not get stream throughput HOT 7
- Cannot read property 'id' of undefined HOT 1
- Intermittent error "Could not get stream throughput" 404; api response "I do not have a metric called [org.graylog2.plugin.streams.Stream.5891ca6995186c0001613209.incomingMessages]." HOT 7
- Error on run HOT 8
- Publish latest version on npmjs HOT 5
- Is it possible to remove specific dashboard.
- Bad status code: 404 Not Found {"type":"ApiError","message":"HTTP 404 Not Found"} HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli-dashboard.