volga-websocket-api
description: The Avassa Volga WebSocket API enables real-time, bidirectional communication for producing and consuming messages using websockets.
Volga Web Socket API
Volga has a websocket API, detailed instructions on how to work with volga and websockets can be found in the Volga fundamentals documentation at https://docs.avassa.io/fundamentals/volga
The websocket API covers three different types of Volga operations
- Normal Volga topic producer and consumer operations.
- Volga infra operations.
- The query API, which runs on top of Volga infra.
A number of operations are described, each operation is a JSON object
with one field called op
. To invoke an operation, send the described
JSON object on the authenticated websocket. See the fundamentals text
on how to setup the websocket and for example code.
Operations
Normal Volga operations
- open-producer
- produce
- sync
- open-consumer
- ack
- more
The pattern for a producer is to open a websocket to a host in a
site, send an open-producer
JSON object with the required parameters, and then produce messages to
the Volga topic by sending produce
messages on the websocket.
It doesn't matter which host in the site you connect to.
The pattern for a consumer is to open a websocket to a Volga site, invoke
open-consumer
with the required parameters, invoke more
and then
start to receive Volga messages on the websocket.
To close a consumer or producer, just close the websocket. If the topic is deleted, the server will close the websocket connection with status code 4100.
Infra-specific operations
- open-infra-producer
- infra-produce
- infra-sync
- open-infra-consumer
Volga infra is a means to distribute messages to all sites in a large system of sites. It is built on top of standard Volga topics that are stitched together by Volga itself.
To use a Volga infra, a named tenant infra must first be created by configuration.
$ supctl create volga infras << EOF
name: myinfra
format: json
EOF
The pattern for a down producer to Volga infra is to
- Establish a websocket to the Control Tower.
- Open an infra producer by sending a
open-infra-producer
JSON object on the websocket. - Send
infra-produce
messages on the websocket with directiondown
, this will then produce the message on all sites in the system - Code running at the edge sites, opens an infra consumer by establishing a websocket to the local site where the code runs.
- The edge tenant code sends a
open-infra-consumer
JSON object on the websocket. - The edge tenant code sends a
more
JSON object on the websocket, at that point the edge code will receive Volga messages on the websocket.
Ping pong
The websocket server will respond to ping frames.
By default, the websocket server will also ping the client, but there is one exception: server-initiated pings are disabled for any client connecting to an Edge Enforcer on its local host (as they typically serve no purpose in this scenario).
Server-initiated pings can be explicitly enabled or disabled by including
the query parameter ping=true
or ping=false
when connecting to the
server. This will always override the default logic of the server.
When server-initiated pings are enabled, one ping is sent out every 45 seconds. A non-responsive client will be disconnected after three consecutive ping attempts.
open-producer
The JSON object to open a producer on a websocket. The
caller will receive a response
JSON object.
Example:
{
"op": "open-producer",
"location": "local",
"topic": "mytopic",
"on-no-exists": "create",
"create-options":
{
"replication-factor": 1,
"persistence": "disk",
"format": "string",
},
"name": "myprod"
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
topic | topic-name | This field is required. The name of the topic at the site. Topic names must be unique for each site for each tenant. A topic resides at a site. |
name | string | This field is required. The name of the producer. The name is not required to be unique. The name will be part of the message the consumers receive. It will also show up in various supctl show volga outputs. Choose a readable name. |
location | enumeration
| This field is required. Where the topic is located. Volga can access topics not only at the site handling the websocket connection, but also at a parent or child site.
|
child-site | string | Name of the site to connect to when location ischild-site . |
on-no-exists | enumeration
| This field is required. What to do if the topic does not exist.
|
create-options | Object see ws-create-options | |
send-control-message | boolean | Send a control message once a topic is properly connected and also when it is disconnected. The message will indicate weather the producer/consumer is properly connected. If for example majority is lost, the producer/consumer will still appear to be functioning to the client. If this option is set, the client get notified when the volga producer/consumer is reconnecting behind the scenes The default value is false . |
on-overload | enumeration
| What to do when a producer om a ram topic is producingfaster than the consumers can consume and the RAM buffer fills up. Note that this applies also to producers that produce in async mode
The default value is block-producer . |
on-no-connection | enumeration
| When a topic is disconnected - and this can be for several reasons. - No RAFT majority in the cluster. - No majority for the topic. - No connection from the edge to the Control Tower. This flag controls the behaviour of a disconnected producer
The default value is block . |
produce
The JSON object to produce to a topic. A response
JSON object is
returned on the websocket.
Example:
{
"op": "produce",
"sync": "sync",
"payload": "Hello Avassa"
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
sync | enumeration
| Messages can be delivered synchronously or asynchronously to Volga. Asynchronous delivery has higher throughput. The default value is sync . |
payload | Object | The payload of the message |
topic-tag | string | If set, the message will only reach consumers listening for this specific topic-tag. |
sync
Data produced to a topic in async mode has not necessarily
been written to disk when the produce call returns. Calling
sync
ensures that all previously produced data is written
to disk. Data produced in sync mode is always written to
disk before the call returns, but calling sync
ensures
that a file system sync call is issued. The caller will
receive a response
JSON object.
Example:
{
"op": "sync"
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
open-consumer
The JSON object to open a consumer on a websocket. The
caller will receive a response
JSON object. No Volga
messages will be received until a more
operation has been
sent on the websocket.
Example:
{
"op": "open-consumer",
"location": "local",
"topic": "mytopic",
"position": "beginning",
"on-no-exists": "wait",
"name": "mycons"
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
topic | topic-name | This field is required. The name of the topic at the site. Topic names must be unique for each site for each tenant. A topic resides at a site. |
location | enumeration
| This field is required. Where the topic is located. Volga can access topics not only at the site handling the websocket connection, but also at a parent or child site.
|
child-site | string | Name of the site to connect to when location ischild-site . |
on-no-exists | enumeration
| This field is required. What to do if the topic does not exist.
|
create-options | Object see ws-create-options | |
send-control-message | boolean | Send a control message once a topic is properly connected and also when it is disconnected. The message will indicate weather the producer/consumer is properly connected. If for example majority is lost, the producer/consumer will still appear to be functioning to the client. If this option is set, the client get notified when the volga producer/consumer is reconnecting behind the scenes The default value is false . |
name | string | This field is required. The name of the consumer. There can be arbitrarily many named consumers. If mode is exclusive , the name must beunique. If a second consumer is opened towards a topic with the same name, instead of returning an error, the first consumer is closed and the second overtakes the topic consumption |
mode | enumeration
| The mode for the consumer.
The default value is exclusive . |
position ORposition-since ORposition-sequence-number ORposition-timestamp | enumeration
duration ORint64 ORunion | Indicates where to start consuming in the topic stream
Format is [<digits>y][<digits>d][<digits>m][<digits>s] .Examples: 1y2d5h , 5h or 10m30s Start consuming from a relative timestamp, eg "1h"Start consuming from a specific sequence number. Negative numbers are relative to the end of the topic.Start consuming from an absolute timestamp expressed either as milliseconds since the epoch or an RFC 3339 timestamp (corresponding to the mtime and time fieldsreceived by a consumer respectively). |
topic-tag | string | If topic-tag is set, only messages produced with the sametopic-tag will be received by this consumer. This can beuseful when multiple applications need to share the same topic of infra. |
re-match | string | Consume only messages that match this Perl RE pattern, and just skip all other messages. |
invert-match | empty | Invert the match provided by the re-match pattern |
fields | select-fields-expression | A string that matches:
For example: - fields=foo,bar - selects the fields foo and bar - fields=foo/bar - selects the fields bar in foo - fields=foo/[bar,baz] - selects bar and baz in foo - fields=foo=x - selects foo , and renames foo to x inthe output Volga can trim incoming messages, delivering only the fields given here. |
end-marker | boolean | If true, a special message is sent when there are no more messages to consume, i.e when a consumer would hang. This looks like a regular Volga message but without payload and sequence number, but with an extra JSON field "end-marker": true .The default value is false . |
compact-output | boolean | This produces newline delimited JSON messages, just like requesting the content-type application/jsonlines on the REST API. The default value is false . |
more
When a consumer has been opened on a websocket, the client must send
the more
JSON object in order to start receive Volga messages. Once
the number of outstanding messages reaches zero, no more Volga messages
messages will be received until a new more
request is sent.
No response
is received for this request.
Example:
{
"op": "more",
"n": 10
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
n | uint32 | This field is required. The number of messages the client will receive until a new more request must be sent |
ack
When topics are opened with position
unread
, messages are consumed
from sequence number where the named consumer last acked plus 1. There
can be an arbitrary number of named consumers for a topic at a site, the
acknowledgment is specific to the name of the consumer.
Consumer that are opened in other modes than unread
need not ack
messages. Note that there is no need to acknowledge every single message.
If you have received and handled 10 messages it is enough to send an
ack
for the last one. The call does not return a response
.
Example:
{
"op": "ack",
"seqno": 1
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
seqno | uint64 | This field is required. Acknowledge the reception of a recently received message. Acks are specific to the named consumer. No response isreceived for this request. |
delete-topic
Administrative call to remove a topic from a site. Returns response
.
Example:
{
"op": "delete-topic",
"location": "local",
"topic": "mytopic"
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
location | enumeration
| Where the topic is located. Volga can access topics not only at the site handling the websocket connection, but also at a parent or child site.
The default value is local . |
child-site | string | Name of the site to connect to when location ischild-site . |
topic | topic-name | This field is required. Name of the topic to delete |
change-options
Change the options of a running topic. Returns response
. Example:
{
"op": "change-options",
"location": "local",
"topic": "mytopic",
"max-size": "50 MB"
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
location | enumeration
| This field is required. Where the topic is located. Volga can access topics not only at the site handling the websocket connection, but also at a parent or child site.
|
child-site | string | Name of the site to connect to when location ischild-site . |
topic | topic-name | This field is required. Name of the topic for which to change options |
num-chunks ORmax-size | uint32 ORsize | Number of chunks to store on disk for the topic. This decides the total size of the topic. Each chunk is 1 MB. When chunk num-chunks + 1 is needed, chunk 1 isdiscarded, etc.Number of bytes with SI prefixes (kB, MB, GB, TB) (powers of 1000) or ISO/IEC prefixes (KiB, MiB, GiB, TiB) (powers of 1024). For example 12GB , 22.2 MiB Maximum size on disk for the topic. The topic is divided into chunks of approximately 1MB each. When max-size is reached, the oldest chunk is deleted. |
max-days | uint32 | Number of days to keep messages on this topic. If not set, messages will be kept until the topic is full. |
open-infra-producer
Volga infra is a means to produce Volga messages to all sites for a
tenant. Send this JSON object on a websocket to open a system wide
producer. If the producer resides at an edge site, it can produce
messages to the Control Tower, or to other edge sites. If the producer
resides at the Control Tower, it can produce messages to all edge sites.
The call returns a response
.
The tenant infra must be created by means of configuration. Once created,
the Volga topics associated to the Infra will reside on all sites in
the system.
To close the producer, just close the websocket. Example:
{
"op": "open-infra-producer",
"infra": "myinfra"
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
infra | topic-name | This field is required. The name of the Volga infra. Infra names must be unique across all sites for each tenant. |
on-overload | enumeration
| What to do when a producer om a ram topic is producingfaster than the consumers can consume and the RAM buffer fills up. Note that this applies also to producers that produce in async mode
The default value is block-producer . |
infra-produce
Produce a message on the Infra. If synchronous, the call returns
response
. Example:
{
"op": "infra-produce",
"direction": "down",
"payload": {"hello": "world"}
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
direction | enumeration
| This field is required.
|
stitch-site | string | If we use stitching, data will go from one edge site to the Control Tower, turn down there and go 'down' to the indicated edge site |
local-site-deliver | boolean | Deliver on infra on the producing site too The default value is false . |
destination-sites | array of Object see destination-site | Deliver only to these sites. If unset, all sites where the current tenant resides will receive the message. |
sync | enumeration
| Messages can be delivered synchronously or asynchronously to Volga. Asynchronous delivery has higher throughput. The default value is sync . |
payload | Object | The payload of the message |
topic-tag | string | If set, the message will only reach consumers listening for this specific topic-tag. |
open-infra-consumer
This call opens an Infra consumer. An Infra consumer behaves like a
a normal topic consumer, the client must issue more
, ack
, etc.
The call returns response
.
To close the consumer, just close the websocket. Example:
{
"op": "open-infra-consumer",
"infra": "myinfra",
"position": "beginning",
"name": "myinfracons"
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
infra | topic-name | This field is required. The name of the Volga infra. Infra names must be unique across all sites for each tenant. |
name | string | This field is required. The name of the consumer. There can be arbitrarily many named consumers. If mode is exclusive , the name must beunique. If a second consumer is opened towards a topic with the same name, instead of returning an error, the first consumer is closed and the second overtakes the topic consumption |
mode | enumeration
| The mode for the consumer.
The default value is exclusive . |
position ORposition-since ORposition-sequence-number ORposition-timestamp | enumeration
duration ORint64 ORunion | Indicates where to start consuming in the topic stream
Format is [<digits>y][<digits>d][<digits>m][<digits>s] .Examples: 1y2d5h , 5h or 10m30s Start consuming from a relative timestamp, eg "1h"Start consuming from a specific sequence number. Negative numbers are relative to the end of the topic.Start consuming from an absolute timestamp expressed either as milliseconds since the epoch or an RFC 3339 timestamp (corresponding to the mtime and time fieldsreceived by a consumer respectively). |
topic-tag | string | If topic-tag is set, only messages produced with the sametopic-tag will be received by this consumer. This can beuseful when multiple applications need to share the same topic of infra. |
re-match | string | Consume only messages that match this Perl RE pattern, and just skip all other messages. |
invert-match | empty | Invert the match provided by the re-match pattern |
fields | select-fields-expression | A string that matches:
For example: - fields=foo,bar - selects the fields foo and bar - fields=foo/bar - selects the fields bar in foo - fields=foo/[bar,baz] - selects bar and baz in foo - fields=foo=x - selects foo , and renames foo to x inthe output Volga can trim incoming messages, delivering only the fields given here. |
end-marker | boolean | If true, a special message is sent when there are no more messages to consume, i.e when a consumer would hang. This looks like a regular Volga message but without payload and sequence number, but with an extra JSON field "end-marker": true .The default value is false . |
compact-output | boolean | This produces newline delimited JSON messages, just like requesting the content-type application/jsonlines on the REST API. The default value is false . |
infra-sync
Equivalent to the regular sync operation. Ensures that
previously sent messages are written to disk and that a
file system sync call is issued. The call returns
response
. Example:
{
"op": "infra-sync"
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
volga-message
Volga message object received by a consumer.
Name | Type | Description |
---|---|---|
time | date-and-time | Message timestamp in RFC 3339 format. |
mtime | uint64 | Message timestamp in milliseconds since the epoch. |
seqno | uint64 | Sequence number of the message. This is the number that can be used to ack the message. |
remain | uint64 | Number of messages remaining until another more call isrequired. |
producer-name | string | The name of the producer of the message. |
host | string | The name of the host that produced the message. |
origin | string | The site where the message originated (only present for infra consumers). |
payload ORend-marker | Object ORboolean | The dataSet if the consumer has requested end-marker and the end of the stream has been reached |
query-topics-message
JSON object which is the result of a query-topics request.
Name | Type | Description |
---|---|---|
time | date-and-time | This field is always present. Message timestamp in RFC 3339 format. |
mtime | uint64 | This field is always present. Message timestamp in milliseconds since the epoch. |
host | string | This field is always present. The name of the host that produced the message |
site | string | This field is always present. The name of the site that produced the message |
application | string | Present if the message was related to a specific application. |
service-name | string | Present if the message was related to a specific service. |
service-instance | string | Present if the message was related to a specific service instance. |
container-name | string | Present if the message was related to a specific container. |
payload | Object |
query-topics-dry-run
Result of a query-topics dry run.
Name | Type | Description |
---|---|---|
specified-sites | array of string | Sites targeted by the query. |
non-responding-sites | array of string | Sites that did not respond. |
site-reports | array of Object see site-report | For each responding site, the list of topics that are going to be searched. |
volga-control-message
If control messages are requested for a consumer or a producer, messages on this format will be received on the websocket.
Name | Type | Description |
---|---|---|
connected | boolean | Boolean indicating the new connection status |
kind | enumeration
|
response
Common response object for a number of operations.
Name | Type | Description |
---|---|---|
result | enumeration
| This field is always present. |
errors | array of Object see response-errors |
query-topics
This is the websocket API to query-topics. The data passed in
is a full query-topics
JSON object, with the additional leaf
op
set to query-topics
. The response varies depending on
the input:
- If
dry-run
istrue
, the response is aquery-topics-dry-run
object. - If
count-matches
istrue
, the response is a simple JSON object containing the number of matches, eg{"count": 36}
. - If an error occurs, the response is a
response
object. - Otherwise, the result will be a stream of matching volga
messages. If
auto-more
is false, the socket will function as a regular volga consumer, initially returning aresponse
object and requiring the client to issuemore
requests in order to receive messages. Ifauto-more
is true, noresponse
object is sent and nomore
messages are required. The server will continuously deliver matching messages.
If payload-only
is false
, the messages will come in the
form of query-topics-message
objects, but if payload-only
is true
, they will be raw volga messages, which can be JSON
objects or plain strings.
Note that it is possible for a single query to contain
multiple sets of topics with different values for
payload-only
. If an error occurs, the response will be
a response
object.
Refer to the REST API documentation and the Volga fundamentals document for a more detailed description of the query-topics functionality.
Example: Search a topic name called mytext
on all sites
and just print the data from that topic.
{
"op": "query-topics",
"follow": true,
"all-sites": true,
"topics":
[
{
"topic-names": ["mytext"],
"output": {"payload-only": true}
}
]
}
Name | Type | Description |
---|---|---|
op | enumeration
| This field is required. |
auto-more | boolean | Send results continuously, with no need for the client to issue more requests. Currently on by default.The default value is true . |
sort | boolean | Sort all messages by timestamp. When true, the control tower will wait for all sites to respond before returning anything to the caller, ensuring that messages are delivered in timestamp order. Note that when follow is also set, it is not possibleto wait for all sites to respond as that would entail waiting indefinitely for possible future messages. Instead, messages are buffered and sorted for up to three seconds, first at the site level and then at the Control Tower, to account for network lag and system clock discrepancies, but under poor conditions it is still possible that some messages will be delivered out of order. The default value is false . |
follow | boolean | If follow is true, the output from the search will continue indefinitely. If follow is false, all sites that participate in the query will utilize the end-marker feature inVolga for the chosen topics and report to the Control Tower when there is no more data. If one ore more sites chosen by the query fails to respond, the unfollow-timeout willtrigger and the query is aborted The default value is false . |
site-timeout | duration | A duration in years, days, hours, minutes and seconds. Format is [<digits>y][<digits>d][<digits>m][<digits>s] .Examples: 1y2d5h , 5h or 10m30s Timeout controlling how long to wait for unresponsive sites to deliver log data The default value is 10s . |
compact-output | boolean | Produce newline-delimited JSON messages. This can make life easier for a parser which consumes the output data. The default value is false . |
dry-run | boolean | This call will report which sites, and topics are chosen by the query. Furthermore, when issuing a query towards a set of sites, if one or several sites are down or unresponsive, this flag will report all sites that never responded, using the site-timeout valueThe default value is false . |
since ORstart-time ORposition-sequence-number | duration ORdate-and-time ORint64 | A duration in years, days, hours, minutes and seconds. Format is [<digits>y][<digits>d][<digits>m][<digits>s] .Examples: 1y2d5h , 5h or 10m30s By default, queries will start at the beginning of all selected topics. This parameter will make the query start at the specified time relative to current time. For example
will search all topics starting with messages from one hour ago.Similar to the since parameter, an explicit start time can bespecified, eg 2022-09-02T18:23:17.153313Z.Begin search at this sequence number in each topic. When searching in multiple topics at once, this is mostly useful with negative negative numbers, for example -100 to search through the last 100 messages of each topic. |
duration ORstop-time | duration ORdate-and-time | A duration in years, days, hours, minutes and seconds. Format is [<digits>y][<digits>d][<digits>m][<digits>s] .Examples: 1y2d5h , 5h or 10m30s This parameter limits the timespan within which messages are searched for.
Will search all topics for messages that are between 50 and 60 minutes old.Similar to the start-time parameter, an explicit stop timecan be specified, eg 2022-09-02T18:23:17.153313Z |
drop-until-n-remain | int32 | At the Control Tower, collect all data according to the provided filters, and deliver the last n items gathered from all the specified sites. This implies follow false |
count-matches | boolean | Count number of occurrences that match the provided filters. Counting occurs at the edge, and starts after start-time settings, and drop settings have been applied. No data is returned, only the count of matches as a single JSON object, for example: {"count": 36} The default value is false . |
site-names ORre-match-sites ORsites-from-application-deployment ORmatch-site-labels ORall-sites | array of string ORregexp ORstring ORlabel-match-expression ORempty | The default value is all-sites .A list of site namesPCRE regular expression.Query all sites that match the given regular expression. To check which sites match the regular expression, use the dry-run flagRun the query only on the sites that have the specifiedapplication deploymentA string that matches:
The {} expression matches the empty label set.For example: (foo and not(bar = xx)) or (baz = red) or {} Use a site label expression to specify which sites to run the query on, for example: Query all sites that the tenant has access to. This is the default. |
topics | array of Object see query-topics |
Common Objects
The ws-create-options Object
Name | Type | Description |
---|---|---|
replication-factor | uint32 | Integer deciding how many replicas to create for a topic. Always use an odd number. A majority of replicas is required for a topic to be operational. The default value is 1 . |
persistence | enumeration
| disk means the topic is persistent on the host where it wasoriginally placed at creation time. If ram is used,replication-factor is implicitly 1.The default value is disk . |
local-placement | boolean | Include the host handling the request in the replication set. For topics with replication-factor 1, this means that the host handling the request is guaranteed to become the topic handler and the topic can never be moved to another host. For topics with higher replication factors, the host handling the request will be part of the initial replication set as long as its maintenance-mode is not set toout-of-service , but the topic can be moved to other hostslater as needed. The default value is false . |
num-chunks ORmax-size | uint32 ORsize | Number of chunks to store on disk for the topic. This decides the total size of the topic. Each chunk is 1 MB. When chunk num-chunks + 1 is needed, chunk 1 isdiscarded, etc.Number of bytes with SI prefixes (kB, MB, GB, TB) (powers of 1000) or ISO/IEC prefixes (KiB, MiB, GiB, TiB) (powers of 1024). For example 12GB , 22.2 MiB Maximum size on disk for the topic. The topic is divided into chunks of approximately 1MB each. When max-size is reached, the oldest chunk is deleted. |
format | enumeration
| The format of messages on this topic.
|
match-host-labels | label-match-expression | A string that matches:
The {} expression matches the empty label set.For example: (foo and not(bar = xx)) or (baz = red) or {} Run the topic on hosts whose labels match the given expression. If not provided, volga will choose from all available hosts on the site. The available host labels in a site can be read from /assigned-sites/SITE as host-labels . |
max-days | uint32 | Number of days to keep messages on this topic. If not set, messages will be kept until the topic is full. |
encryption | enumeration
| Messages can be encrypted or cryptograhically signed when written to disk. |
transit-key | name | Transit key to use for signing or encryption. When creating topics in the Control Tower itself, the key will automatically be created if it does not already exist. For topics on edge sites, the key must be created beforehand. |
ephemeral | boolean | If set to true, the topic will be deleted immediately when there are no connected producers or consumers. The default value is false . |
The destination-site Object
Name | Type | Description |
---|---|---|
site | string |
The query-topics Object
A topic query consists of site selection, and then a list of topic selectors, combined with with filters and output modifiers. Thus, multiple topics can be searched with the same query, applying different filters and output modifiers to each set of of topics in the topic list
Name | Type | Description |
---|---|---|
topic-names ORre-match-topic-name ORmatch-topic-labels | array of topic-name ORregexp ORlabel-match-expression | A list of topic namesPCRE regular expression. A regular expression that matches one or more topicsA string that matches:
The {} expression matches the empty label set.For example: (foo and not(bar = xx)) or (baz = red) or {} Choose topics based on the topic labels |
filter | Object see query-topics-filter | |
output | Object see query-topics-output |
The query-topics-filter Object
Name | Type | Description |
---|---|---|
re-opts | array of enumeration
| Regular expression flags to apply to expressions in this filter. The re-opts applies to all the various filter expressions, but not to the site selection |
merged-drop-until-re-match ORmerged-drop-until-string-match | regexp ORstring | PCRE regular expression. On the merged output from all topics, and all sites, drop all data until the provided regular expression matches. Stream from that point forward. This is only useful when you have applications at different sites that interact. Otherwise it is better to use the drop-until-re-match flagOn the merged output from all topics and all sites,drop all data until the provided string matches. Stream from that point forward. This is only useful when you have applications at different sites that interact. Otherwise it is better to use the drop-until-string-match flag |
merged-re-match | regexp | PCRE regular expression. Run regular expression match on the merged output from all sites. Similar to merge-drop-until-re-match ,this is only meaningful when there is interaction between applications at multiple sites. |
drop-until-re-match ORdrop-until-string-match ORdrop-until-last-re-match ORdrop-until-last-string-match | regexp ORregexp ORregexp ORstring | PCRE regular expression. On the selected topics, search for the first entry matching the provided regular expression and stream from that point forwardPCRE regular expression. On the selected topics, search for the provided string and stream from that point forward.PCRE regular expression. On the selected topics, search for the last (newest) entry that matches the provided regular expression, and stream from that point on.On the selected topics, search for the last (newest) entry that matches the provided string, and stream from that point on. |
re ORstring ORre-match ORmatch-json | Object see query-topics-filter-re ORObject see query-topics-filter-string ORregexp ORObject | PCRE regular expression. On the selected topics, return only entries that match the provided regular expressionA JSON object that that is matched against the payload. This is best explained by an example. Assume that an item in the payload data in a chosen topic looks like:
The following JSON objects will match the entry above, thus ensuring that the log item is chosen. First example is an AND match, both entries must match
The JSON value null is used as a wildcard, thus resulting in astructure match only
Next example is an OR based list match, if we provide multiple entries in a list, at least one of the entries in the provided list must match
And finally a combination of AND and OR based match with a list of structs that will match
|
The query-topics-filter-re Object
Name | Type | Description |
---|---|---|
match | array of regexp | PCRE regular expression. On all sites where the query runs, search for entries in the chosen topics that match all the provided regular expressions. |
no-match | array of regexp | PCRE regular expression. On all sites where the query runs, search for entries in the chosen topics that do not match any of the provided regular expressions. |
The query-topics-filter-string Object
Name | Type | Description |
---|---|---|
match | array of string | On all sites where the query runs, search for entries in the chosen topics that match all the provided strings. |
no-match | array of string | On all sites where the query runs, search for entries in the chosen topics that do not match any of the provided strings. |
The query-topics-output Object
Name | Type | Description |
---|---|---|
payload-only | boolean | Deliver payload only. By default, Volga will embed the log entry in a JSON object with additional data about the entry, such as the time when the message was produced etc The default value is false . |
format | string | With payload-only data for text logs, Volga can be instructed to prepend each line with a header, thus making it possible to distinguish between log entries from different sites/hosts/topics. The following modifiers are available: - %h The host that produced the message - %s The site that produced the message - %p The payload of the message - %t The time when the log entry was originally produced - %T The name of the topic the message originates from The default value is %h : %p . |
fields | select-fields-expression | A string that matches:
For example: - fields=foo,bar - selects the fields foo and bar - fields=foo/bar - selects the fields bar in foo - fields=foo/[bar,baz] - selects bar and baz in foo - fields=foo=x - selects foo , and renames foo to x inthe output If output is JSON, Volga can trim the messages, displaying only certain fields. If payload-only is true, thetrimming will occur at the edge site, otherwise it will occur on the JSON message constructed by Volga |
The response-errors Object
Name | Type | Description |
---|---|---|
error-message | string | |
error-info | Object see volga-api-error |
The volga-api-error Object
Name | Type | Description |
---|---|---|
reason | enumeration
| This is a list of errors that can occur over websocket and the REST interface to volga
|
The site-report Object
Name | Type | Description |
---|---|---|
site | string | |
topics | array of string |