Socket
Socket
Sign inDemoInstall

fastify-graylog-reporter

Package Overview
Dependencies
63
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.5.0 to 1.6.0

img.png

4

CHANGELOG.md

@@ -1,2 +0,2 @@

# [1.5.0](https://github.com/Blynskyniki/fastify-graylog-reporter/compare/v1.4.0...v1.5.0) (2023-10-12)
# [1.6.0](https://github.com/Blynskyniki/fastify-graylog-reporter/compare/v1.5.0...v1.6.0) (2023-10-12)

@@ -6,2 +6,2 @@

* fix timestamp ([4507689](https://github.com/Blynskyniki/fastify-graylog-reporter/commit/45076893c86cc4fb4536a1ae912e9b927cc40ab2))
* make timestamp optional ([367a62f](https://github.com/Blynskyniki/fastify-graylog-reporter/commit/367a62fbd44e61b876ba04fa412db4de4b4d31f9))

@@ -21,3 +21,3 @@ import { GelfMessageSerializer } from './gelfMessageSerializer';

full_message?: string;
timestamp: number;
timestamp?: number;
[key: string]: any;

@@ -24,0 +24,0 @@ };

@@ -16,3 +16,2 @@ "use strict";

host: headers.location || 'empty',
timestamp: +(new Date()),
short_message: `${routerMethod}:${routerPath} ${JSON.stringify(query || body || {})}`,

@@ -19,0 +18,0 @@ path: routerPath,

GELF via UDP
Chunking
UDP datagrams are limited to a size of 65536 bytes. Some Graylog components are limited to processing up to 8192 bytes. Substantial compressed information fits within the size limit, but you may have more information to send; this is why Graylog supports chunked GELF.
UDP datagrams are limited to a size of 65536 bytes. Some Graylog components are limited to processing up to 8192 bytes.
Substantial compressed information fits within the size limit, but you may have more information to send; this is why
Graylog supports chunked GELF.
You can define chunks of messages by prepending a byte header to a GELF message, including a message ID and sequence number to reassemble the message later. Most GELF libraries support chunking transparently and will detect if a message is too big to be sent in one datagram.
You can define chunks of messages by prepending a byte header to a GELF message, including a message ID and sequence
number to reassemble the message later. Most GELF libraries support chunking transparently and will detect if a message
is too big to be sent in one datagram.
TCP would solve this problem on a transport layer, but it has other problems that are even harder to tackle: slow connections, timeouts, and other network problems.
TCP would solve this problem on a transport layer, but it has other problems that are even harder to tackle: slow
connections, timeouts, and other network problems.
Messages can be lost with UDP, and TCP can dismantle the whole application when not designed carefully.
Of course, especially in high-volume environments, TCP is sensible. Many GELF libraries support both TCP and UDP as transport, and some also support https.
Of course, especially in high-volume environments, TCP is sensible. Many GELF libraries support both TCP and UDP as
transport, and some also support https.

@@ -16,8 +22,11 @@ Prepend the following structure to your GELF message to make it chunked:

Chunked GELF magic bytes - 2 bytes: 0x1e 0x0f
Message ID - 8 bytes: Must be the same for every chunk of this message. Identifies the whole message and is used to reassemble the chunks later. Generate from millisecond timestamp + hostname, for example.
Message ID - 8 bytes: Must be the same for every chunk of this message. Identifies the whole message and is used to
reassemble the chunks later. Generate from millisecond timestamp + hostname, for example.
Sequence number - 1 byte: The sequence number of this chunk starts at 0 and is always less than the sequence count.
Sequence count - 1 byte: Total number of chunks this message has.
All chunks MUST arrive within 5 seconds or the server will discard all chunks that have arrived or are in the process of arriving. A message MUST NOT consist of more than 128 chunks.
All chunks MUST arrive within 5 seconds or the server will discard all chunks that have arrived or are in the process of
arriving. A message MUST NOT consist of more than 128 chunks.
Warning: Please note that the UDP-Inputs of Graylog use the SO_REUSEPORT socket option, which was introduced in Linux kernel version 3.9. So be aware that UDP inputs will NOT work on Linux kernel versions before 3.9.
Warning: Please note that the UDP-Inputs of Graylog use the SO_REUSEPORT socket option, which was introduced in Linux
kernel version 3.9. So be aware that UDP inputs will NOT work on Linux kernel versions before 3.9.
Compression

@@ -30,3 +39,4 @@ When using UDP as transport layer, GELF messages can be sent uncompressed or compressed with either GZIP or ZLIB.

GELF via TCP
At the current time, GELF TCP only supports uncompressed and non-chunked payloads. Each message needs to be delimited with a null byte (\0) when sent in the same TCP connection.
At the current time, GELF TCP only supports uncompressed and non-chunked payloads. Each message needs to be delimited
with a null byte (\0) when sent in the same TCP connection.

@@ -52,3 +62,4 @@ Warning: GELF TCP does not support compression due to the use of the null byte (\0) as frame delimiter.

seconds since UNIX epoch with optional decimal places for milliseconds; SHOULD be set by the client library. If absent, the timestamp will be set to the current time (now).
seconds since UNIX epoch with optional decimal places for milliseconds; SHOULD be set by the client library. If absent,
the timestamp will be set to the current time (now).
level number

@@ -65,22 +76,29 @@

the file (with path, if you want) that caused the error (string); optional, deprecated. Send as an additional field instead.
the file (with path, if you want) that caused the error (string); optional, deprecated. Send as an additional field
instead.
_[additional field] string (UTF-8) or number
every field you send and prefix with an underscore ( _) will be treated as an additional field. Allowed characters in field names are any word character (letter, number, underscore), dashes and dots. The , verifying regular expression is: ^[\\w\\.\\-]*$. Libraries SHOULD not allow to send id as additional field ( _id). Graylog server nodes omit this field automatically.
every field you send and prefix with an underscore ( _) will be treated as an additional field. Allowed characters in
field names are any word character (letter, number, underscore), dashes and dots. The , verifying regular expression
is: ^[\\w\\.\\-]*$. Libraries SHOULD not allow to send id as additional field ( _id). Graylog server nodes omit this
field automatically.
Example Payload
This is an example GELF message payload. Any Graylog-server node accepts and stores this as a message when GZIP/ZLIB is compressed or even when sent uncompressed over a plain socket without new lines.
This is an example GELF message payload. Any Graylog-server node accepts and stores this as a message when GZIP/ZLIB is
compressed or even when sent uncompressed over a plain socket without new lines.
Hint: New lines must be denoted with the \n escape sequence to ensure the payload is valid JSON as per RFC 7159.
![img.png](img.png)
```json
{
"version": "1.1",
"host": "example.org",
"short_message": "A short message that helps you identify what is going on",
"full_message": "Backtrace here\n\nmore stuff",
"timestamp": 1385053862.3072,
"level": 1,
"_user_id": 9001,
"_some_info": "foo",
"_some_env_var": "bar"
"version": "1.1",
"host": "example.org",
"short_message": "A short message that helps you identify what is going on",
"full_message": "Backtrace here\n\nmore stuff",
"timestamp": 1385053862.3072,
"level": 1,
"_user_id": 9001,
"_some_info": "foo",
"_some_env_var": "bar"
}

@@ -87,0 +105,0 @@

{
"name": "fastify-graylog-reporter",
"version": "1.5.0",
"version": "1.6.0",
"description": "Fastify plugin for report request data to Graylog",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/Blynskyniki/fastify-graylog-reporter#readme",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc