Skip to content

Commit 93b7850

Browse files
author
KJ Tsanaktsidis
committed
Add Cue documentation for the inode & credential socket info
1 parent b217d94 commit 93b7850

File tree

1 file changed

+45
-0
lines changed
  • website/cue/reference/components/sources/base

1 file changed

+45
-0
lines changed

website/cue/reference/components/sources/base/socket.cue

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,34 @@ base: components: sources: socket: configuration: {
1818
required: false
1919
type: uint: unit: "connections"
2020
}
21+
credentials_key: {
22+
description: """
23+
If set, on a stream socket, output events will contain information about
24+
the UID/GID/PID of the process which connected to the socket. Note that
25+
this information is subject to some race conditions and is not available
26+
in all circumstances:
27+
28+
* If a process exits after connecting, and passes the socket on to a different
29+
process, (e.g. a child), the pid might now refer to a different process
30+
(or, on some platforms, might not be returned at all)
31+
* If a process connects to this socket source, writes data, and immediately
32+
disconnects, it's possible Vector won't query the peer credentials before
33+
the other process disconnects; in this case, the data won't be available
34+
on some platforms.
35+
36+
Vector configurations should be prepared for this information to be absent,
37+
incorrect, or only partially present; it's a best-guess only.
38+
39+
Peer credential information cannot currently be collected for datagram sockets,
40+
and setting this key will simply produce a null object.
41+
42+
The key will be set with an object containing `"uid"`, `"gid"`, and `"pid"`
43+
keys, or `null` if the information was not available.
44+
45+
By default, this key is not emitted. Set to `""` to explicitly suppress
46+
this key.
47+
"""
48+
}
2149
decoding: {
2250
description: "Configures how events are decoded from raw bytes."
2351
required: false
@@ -236,6 +264,23 @@ base: components: sources: socket: configuration: {
236264
required: false
237265
type: string: default: "host"
238266
}
267+
inode_key: {
268+
description: """
269+
If set, output events will contain the device & inode number of the
270+
socket under this key. For stream sockets, this will be a unique
271+
identifier of each incoming connection; for datagram sockets, this
272+
will be the same value for every incoming message (but can uniquely
273+
identify this source).
274+
275+
The key will be set with an object containing `"dev"` and `"ino"` keys
276+
representing the device & inode number of the socket.
277+
278+
By default, this key is not emitted. Set to `""` to explicitly suppress
279+
this key.
280+
"""
281+
required: false
282+
type: string: default: ""
283+
}
239284
keepalive: {
240285
description: "TCP keepalive settings for socket-based components."
241286
relevant_when: "mode = \"tcp\""

0 commit comments

Comments
 (0)