Skip to main content

Infrastructure prerequisites

The Audit service requires the following components to be set up before it can be started:
  • Docker engine
  • Kafka
  • Elasticsearch
Redis is not required. As of FlowX.AI 5.6.0, audit-core no longer depends on Redis. If you previously configured Redis for this service, those environment variables can be removed from your deployment.

Dependencies

The Audit service is built as a Docker image and runs on top of Kafka and Elasticsearch. Therefore, these services must be set up and running before starting the Audit service.

Configuration

Configuring Kafka

To configure the Kafka server for the Audit service, set the following environment variables:

Connection settings

VariableDescriptionDefault Value
KAFKA_BOOTSTRAP_SERVERSKafka broker addresses (fallback: SPRING_KAFKA_BOOTSTRAP_SERVERS)localhost:9092
KAFKA_SECURITY_PROTOCOLSecurity protocol for Kafka connections (fallback: SPRING_KAFKA_SECURITY_PROTOCOL)PLAINTEXT
KAFKA_MESSAGE_MAX_BYTESMaximum message size (bytes)52428800 (50 MB)

Consumer configuration

VariableDescriptionDefault Value
SPRING_KAFKA_CONSUMER_GROUPIDConsumer group ID for audit logsaudit-gid
KAFKA_CONSUMER_THREADSNumber of consumer threads1
KAFKA_AUTHEXCEPTIONRETRYINTERVALRetry interval after auth failure (seconds)10

OAuth authentication (when using SASL_PLAINTEXT)

Environment VariableDescriptionDefault Value
KAFKA_OAUTH_CLIENT_IDOAuth client IDkafka
KAFKA_OAUTH_CLIENT_SECRETOAuth client secretkafka-secret
KAFKA_OAUTH_TOKEN_ENDPOINT_URIOAuth token endpointkafka.auth.localhost
When using the kafka-auth profile, the security protocol will automatically be set to SASL_PLAINTEXT and the SASL mechanism will be set to OAUTHBEARER.

Topic naming configuration

VariableDescriptionDefault Value
KAFKA_TOPIC_NAMING_PACKAGEPackage prefix for topic namesai.flowx.
KAFKA_TOPIC_NAMING_ENVIRONMENTEnvironment segment for topic names
KAFKA_TOPIC_NAMING_VERSIONVersion suffix for topic names.v1
KAFKA_TOPIC_NAMING_SEPARATORPrimary separator for topic names.
KAFKA_TOPIC_NAMING_SEPARATOR2Secondary separator for topic names-

Kafka topics

VariableDescriptionDefault Value
KAFKA_TOPIC_AUDIT_INTopic for receiving audit logsai.flowx.core.trigger.save.audit.v1

Configuring Elasticsearch

Configure Elasticsearch connection for audit data storage:
VariableDescriptionDefault Value
SPRING_ELASTICSEARCH_REST_PROTOCOLConnection protocolhttps
SPRING_ELASTICSEARCH_REST_URISURL(s) of Elasticsearch nodes (no protocol)-
SPRING_ELASTICSEARCH_REST_DISABLESSLDisable SSL verificationfalse
SPRING_ELASTICSEARCH_REST_USERNAMEAuthentication username-
SPRING_ELASTICSEARCH_REST_PASSWORDAuthentication password-
FLOWX_ELASTICSEARCH_INDEXSETTINGS_NAMEAudit data stream nameaudit-logs
FLOWX_ELASTICSEARCH_INDEXSETTINGS_SHARDSNumber of primary shards2
FLOWX_ELASTICSEARCH_INDEXSETTINGS_REPLICASNumber of replica shards0
The Elasticsearch index settings determine how your audit data is distributed and replicated across the cluster. The number of shards affects search performance and indexing, while replicas provide redundancy.

CAS lib configuration

Environment VariableDescriptionDefault Value
FLOWX_SPICEDB_HOSTSpiceDB server hostnamespicedb
FLOWX_SPICEDB_PORTSpiceDB server port50051
FLOWX_SPICEDB_TOKENSpiceDB authentication token-

Configuring logging

To control the log levels, set the following environment variables:
VariableDescriptionDefault Value
LOGGING_LEVEL_ROOTLog level for root serviceINFO
LOGGING_LEVEL_APPLog level for applicationINFO

Ingress configuration

The Audit Core service uses the standard FlowX.AI ingress pattern. For complete setup instructions including the full ingress template, CORS configuration, and troubleshooting, see the Ingress Configuration Guide. Service-specific values for Audit Core:
  • Ingress name: audit-core-admin
  • Service path: /audit(/|$)(.*)(/|$)(.*)
  • Service name: audit-core
  • Rewrite target: /$2
  • Fx-Workspace-Id: Required

Complete Ingress Configuration

View the centralized ingress guide for the complete configuration template, annotations reference, and best practices.

Troubleshooting

Common issues

Symptoms: Audit events are not being recorded or are missing from search results.Solutions:
  1. Verify the KAFKA_TOPIC_AUDIT_IN topic exists and matches the topic other services publish to (ai.flowx.core.trigger.save.audit.v1)
  2. Check that the consumer group ID (SPRING_KAFKA_CONSUMER_GROUPID) is correctly configured and not conflicting with another consumer
  3. Ensure Kafka connectivity by verifying KAFKA_BOOTSTRAP_SERVERS is reachable from the pod
  4. Check consumer thread count (KAFKA_CONSUMER_THREADS) — increase if throughput is insufficient
Symptoms: Service fails to start or throws connection errors related to Elasticsearch.Solutions:
  1. Verify SPRING_ELASTICSEARCH_REST_URIS points to a reachable Elasticsearch node (do not include the protocol in this value)
  2. Check that SPRING_ELASTICSEARCH_REST_PROTOCOL matches your Elasticsearch setup (https or http)
  3. If using SSL, ensure SPRING_ELASTICSEARCH_REST_DISABLESSL is set appropriately and certificates are valid
  4. Verify SPRING_ELASTICSEARCH_REST_USERNAME and SPRING_ELASTICSEARCH_REST_PASSWORD credentials are correct
Symptoms: Elasticsearch disk usage grows rapidly or cluster health turns yellow/red.Solutions:
  1. Review your index lifecycle management (ILM) policies to ensure old audit data is rolled over and deleted on schedule
  2. Adjust FLOWX_ELASTICSEARCH_INDEXSETTINGS_SHARDS and FLOWX_ELASTICSEARCH_INDEXSETTINGS_REPLICAS — fewer replicas reduce storage at the cost of redundancy
  3. Check the FLOWX_ELASTICSEARCH_INDEXSETTINGS_NAME data stream for excessive index count
  4. Consider reducing the retention period for audit logs in your ILM policy
Symptoms: Audit entries appear in Elasticsearch with significant delay after the triggering action.Solutions:
  1. Check Kafka consumer lag for the audit consumer group using your Kafka monitoring tools
  2. Increase KAFKA_CONSUMER_THREADS to allow parallel consumption if lag is consistently high
  3. Verify Elasticsearch cluster health — a degraded cluster slows down indexing
  4. Check KAFKA_AUTHEXCEPTIONRETRYINTERVAL — frequent auth failures with long retry intervals can cause delays

Audit Log

Learn about the audit logging system and how to view audit trails

Elasticsearch Indexing

Configure Elasticsearch indexing for process data
Last modified on March 25, 2026