Skip to content

Commit a1a2fc5

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

File tree

1 file changed

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

1 file changed

+47
-0
lines changed

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,36 @@ 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+
required: false
49+
type: string: default: ""
50+
}
2151
decoding: {
2252
description: "Configures how events are decoded from raw bytes."
2353
required: false
@@ -236,6 +266,23 @@ base: components: sources: socket: configuration: {
236266
required: false
237267
type: string: default: "host"
238268
}
269+
inode_key: {
270+
description: """
271+
If set, output events will contain the device & inode number of the
272+
socket under this key. For stream sockets, this will be a unique
273+
identifier of each incoming connection; for datagram sockets, this
274+
will be the same value for every incoming message (but can uniquely
275+
identify this source).
276+
277+
The key will be set with an object containing `"dev"` and `"ino"` keys
278+
representing the device & inode number of the socket.
279+
280+
By default, this key is not emitted. Set to `""` to explicitly suppress
281+
this key.
282+
"""
283+
required: false
284+
type: string: default: ""
285+
}
239286
keepalive: {
240287
description: "TCP keepalive settings for socket-based components."
241288
relevant_when: "mode = \"tcp\""

0 commit comments

Comments
 (0)