Seq stores two kinds of data. Log events are stored in Seq's embedded storage engine, called Flare. Documents, like users and signals are stored in a separate metastore, which may be Flare (the default), or a SQL database like SQL Server or PostgreSQL.
Events aren't stored in the metastore
Seq won't store log events in the SQL Server database. Only documents like users and signals will be stored there. Since the metastore is usually small, even for large instances, you probably won't need to provision a large server for its documents.
Multiple Seq instances using the same SQL Server metastore are not supported
Seq needs exclusive access to its metastore. To host multiple metastores on the same SQL Server instance, specify
--schemawhen converting to SQL Server storage, or set the
metastore.msSql.connectionString configuration setting is given a non-null value then Seq will use that connection string as the source of the metastore.
seq secret set -k metastore.msSql.connectionString -v "Initial Catalog=seq-local;Integrated Security=True"
The connection string can also be specified in the
SEQ_METASTORE_MSSQL_CONNECTIONSTRING environment variable, or piped from a file/
cat connection-string.txt | seq secret set -k metastore.msSql.connectionString --value-stdin
The first time it runs, Seq will execute its migrations on the chosen schema.
As an example, say we want to use the connection string
Initial Catalog=seq-local\;Integrated Security=True. An existing Seq instance can be migrated to this SQL Server database using the
metastore to-mssql command:
seq metastore to-mssql --connection-string "Initial Catalog=seq-local;Integrated Security=True" --skip-config
In this example, we also pass
--skip-config, so that the connection string itself isn't saved into the
Seq.json file. To see a full list of options that
to-mssql accepts, run
seq help metastore to-mssql.
Now when starting the container, passing the same connection string in the
SEQ_METASTORE_MSSQL_CONNECTIONSTRING environment variable will use that database as the metastore:
SEQ_METASTORE_MSSQL_CONNECTIONSTRING="Initial Catalog=seq-local;Integrated Security=True" seq run
Many Azure services use managed service identities for connecting to SQL databases. When connecting to an Azure SQL Database instance, specify
ActiveDirectoryDefault as the authentication type in your connection string:
If the managed service identity has access to multiple tenants, an additional
SEQ_METASTORE_MSSQL_MSITENANTID value must be provided to select the tenant in which the identity is acting.
Updated over 1 year ago