Version: 1.4.9This documentation is for Spitfire 1.4.9.
Log collection (syslog, NetScaler, files, Fluent Bit, Splunk, journald, Windows, Kubernetes)
The install and test steps are below. For how log records show on the Backend tab see Observability → Logs.
Before you start
- Settings → General → Public address is set.
https://spitfire.example.com - Add an OTLP receiver and copy its
sfotlp_token.Observability → Add → OTLP receiver → Save → Copy the token - On the Log collectors card pick the source and press Generate configuration; the commands
below come ready there with your address.
Observability → Log collectors → <source> → Generate configuration
One-line install
Linux (Docker or the otelcol-contrib package; the token is asked hidden):
curl -fsSL "https://<spitfire>/api/v1/setup/ds/logs.sh" -o /tmp/sf-logs.sh && SF_SOURCE=syslog bash /tmp/sf-logs.shWindows (open PowerShell as administrator):
$env:SF_SOURCE='windowseventlog'; irm "https://<spitfire>/api/v1/setup/ds/logs.ps1" | iexSF_SOURCE values: syslog, netscaler, filelog, fluentforward, splunk_hec, journald,
logstash, vector (Linux); windowseventlog, filelog (Windows).
To remove it:
SF_ACTION=uninstall SF_SOURCE=syslog bash /tmp/sf-logs.shSuccess check
- Send a test record (syslog example).
logger --rfc5424 -d -n 127.0.0.1 -P 5514 -p user.err -t spitfire-test "spitfire-test ERROR log collection works" - On the card the First records row turns green:
1 records arrivedandspitfire-test.Observability → Log collectors → First records - If nothing comes, the Collector's log:
sudo docker logs spitfire-logs-syslog 2>&1 | tail -n 30 || sudo journalctl -u otelcol-contrib -n 30 --no-pager
Syslog
- Install:
curl -fsSL "https://<spitfire>/api/v1/setup/ds/logs.sh" -o /tmp/sf-logs.sh && SF_SOURCE=syslog SF_PORT=5514 SF_TRANSPORT=udp SF_PROTOCOL=rfc5424 bash /tmp/sf-logs.sh - Point rsyslog at the Collector:
echo '*.* @<collector-host>:5514;RSYSLOG_SyslogProtocol23Format' | sudo tee /etc/rsyslog.d/90-spitfire.conf && sudo systemctl restart rsyslog - Check:
logger -p user.err -t spitfire-test "spitfire-test ERROR"→ First records.
NetScaler (Citrix ADC)
- Install (NetScaler sends RFC 3164):
curl -fsSL "https://<spitfire>/api/v1/setup/ds/logs.sh" -o /tmp/sf-logs.sh && SF_SOURCE=netscaler SF_PORT=5514 SF_TRANSPORT=udp SF_PROTOCOL=rfc3164 bash /tmp/sf-logs.sh - NetScaler CLI: the syslog action, policy and global bind.
add audit syslogAction sf_syslog <collector-ip> -serverPort 5514 -transport UDP -logLevel ALL -userDefinedAuditlog YES add audit syslogPolicy sf_syslog_pol true sf_syslog bind audit syslogGlobal -policyName sf_syslog_pol -priority 100 - A line per request (client IP, vserver, method, URL, HTTP status):
add audit messageaction sf_http INFORMATIONAL "\"client=\" + CLIENT.IP.SRC + \" vserver=\" + HTTP.REQ.LB_VSERVER.NAME + \" method=\" + HTTP.REQ.METHOD + \" url=\" + HTTP.REQ.URL.PATH + \" status=\" + HTTP.RES.STATUS" add rewrite policy sf_http_pol true NOREWRITE -logAction sf_http bind lb vserver <vserver-name> -policyName sf_http_pol -priority 900 -gotoPriorityExpression NEXT -type RESPONSE save ns config - Check (on the Collector host):
printf '<131>%s 10.0.0.10 0-PPE-0 : default AAA Message 1 0 : "client=203.0.113.7 vserver=vs_web method=GET url=/api/orders status=503 rt_ms=1840"\n' "$(date '+%b %e %H:%M:%S')" | nc -u -w1 127.0.0.1 5514
Parsed fields:
| Source | Fields |
|---|---|
Native format (Source, Vserver, Client_ip) |
client.address, netscaler.vserver |
CEF / audit (AppFW: src=, request=, method=, act=) |
client.address, url.path, http.request.method, netscaler.module, netscaler.event, netscaler.action; CEF severity 7+ is an error |
Message action (client= vserver= method= url= status= rt_ms=) |
client.address, netscaler.vserver, http.request.method, url.path, http.response.status_code (5xx error, 4xx warn), http.server.request.duration (s) |
For the response time use an expression that adds rt_ms=<milliseconds> to the line
(your ADC version's transaction time expression); without it the field stays empty and the
others are parsed.
AppFlow/IPFIX: the contrib Collector's netflow receiver (alpha) takes IPFIX but
cannot decode NetScaler's AppFlow HTTP templates (URL, status, response time). Use the syslog path
above for the HTTP fields. NetScaler metrics (NITRO API) are in Infrastructure sources.
Log files
- Install (nginx example; under Docker the files' folder is mounted read-only):
curl -fsSL "https://<spitfire>/api/v1/setup/ds/logs.sh" -o /tmp/sf-logs.sh && SF_SOURCE=filelog SF_PATHS='/var/log/nginx/access.log' SF_PARSER=nginx bash /tmp/sf-logs.sh - Check:
echo "$(date -u +%FT%TZ) ERROR spitfire-test log collection works" | sudo tee -a /var/log/app/app.log
Line formats: none, json, nginx, apache (combined; 5xx error, 4xx warn), regex (named
groups; on the card only, the script uses none).
Fluentd / Fluent Bit
- Install:
curl -fsSL "https://<spitfire>/api/v1/setup/ds/logs.sh" -o /tmp/sf-logs.sh && SF_SOURCE=fluentforward SF_PORT=24224 bash /tmp/sf-logs.sh - Fluent Bit output (
fluent-bit.conf):[OUTPUT] Name forward Match * Host <collector-host> Port 24224 - Fluentd output:
<match **> @type forward <server> host <collector-host> port 24224 </server> </match>
Splunk
Splunk connects two ways:
| Way | What | Where |
|---|---|---|
| Splunk HEC (push) | an app, Fluent Bit, Vector or OTel sending to HEC → Collector :8088 → Spitfire |
Log collectors → Splunk HEC |
| Splunk search API (pull) | Spitfire → Splunk management port :8089, /services/search/jobs/export, read-only |
Connections → Log stores → Splunk |
HEC install:
curl -fsSL "https://<spitfire>/api/v1/setup/ds/logs.sh" -o /tmp/sf-logs.sh && SF_SOURCE=splunk_hec SF_PORT=8088 bash /tmp/sf-logs.sh- Point the sender's HEC address at the Collector:
http://<collector-host>:8088/services/collector/event - Check:
curl -sS http://127.0.0.1:8088/services/collector/event -H 'Authorization: Splunk any' -d '{"event":"spitfire-test ERROR log collection works","source":"spitfire-test"}'
Search API connection:
- Create a token with the search capability in Splunk.
Settings → Tokens → New Token - Add the connection in Spitfire.
Observability → Add → Splunk URL: https://splunk.corp:8089 Auth: Splunk token (Bearer) Index: main - Test connection → the Splunk version shows.
The Splunk connection comes with the monitoring events add-on.
journald
curl -fsSL "https://<spitfire>/api/v1/setup/ds/logs.sh" -o /tmp/sf-logs.sh && SF_SOURCE=journald SF_UNITS=nginx.service,api.service bash /tmp/sf-logs.sh- Check:
logger -p user.err -t spitfire-test "spitfire-test ERROR log collection works"
The journald receiver is alpha in contrib; the script always installs the package (it needs journalctl).
Windows event logs
- Open PowerShell as administrator:
$env:SF_SOURCE='windowseventlog'; $env:SF_CHANNELS='Application,System'; irm "https://<spitfire>/api/v1/setup/ds/logs.ps1" | iex - Check (the script writes one too):
Write-EventLog -LogName Application -Source 'spitfire-test' -EventId 1 -EntryType Error -Message 'spitfire-test ERROR log collection works'
The token is in C:\ProgramData\Spitfire\otlp-token (only SYSTEM and
Administrators read it). The windowseventlog receiver is alpha in contrib.
Kubernetes
- The namespace and the token secret:
kubectl create namespace spitfire-logs --dry-run=client -o yaml | kubectl apply -f - read -rsp "OTLP token (sfotlp_...): " SF_T && echo && kubectl -n spitfire-logs create secret generic spitfire-otlp --from-literal=token="$SF_T" --dry-run=client -o yaml | kubectl apply -f - && unset SF_T - The Helm values and the install:
curl -fsSL "https://<spitfire>/api/v1/setup/logs/config?source=kubernetes&events=1&format=yaml" -o /tmp/spitfire-logs-values.yaml helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts && helm repo update open-telemetry helm upgrade --install spitfire-logs open-telemetry/opentelemetry-collector -n spitfire-logs -f /tmp/spitfire-logs-values.yaml - Check:
kubectl -n spitfire-logs rollout status daemonset -l app.kubernetes.io/instance=spitfire-logs --timeout=120s kubectl run spitfire-test --rm -i --restart=Never --image=busybox:1.36 -- sh -c 'echo "ERROR spitfire-test log collection works"'
Logstash and Vector
curl -fsSL "https://<spitfire>/api/v1/setup/ds/logs.sh" -o /tmp/sf-logs.sh && SF_SOURCE=logstash SF_PORT=5170 bash /tmp/sf-logs.sh- Logstash output (
spitfire.conf):output { tcp { host => "<collector-host>" port => 5170 codec => json_lines } } - Vector sink (
spitfire.yaml;SF_SOURCE=vector):sinks: spitfire: type: socket inputs: ["*"] address: "<collector-host>:5170" mode: tcp encoding: codec: json framing: method: newline_delimited - Check:
echo '{"level":"error","message":"spitfire-test ERROR log collection works","service.name":"spitfire-test"}' | nc -w1 127.0.0.1 5170
Reading from log stores (read-only)
| Store | URL | Auth | Read |
|---|---|---|---|
| Elasticsearch | https://es.corp:9200 |
API key or user (read on the index) | _search + date_histogram, 50 error examples |
| OpenSearch | https://os.corp:9200 |
User (read on the index) | _search + date_histogram, 50 error examples |
| Graylog | https://graylog.corp:9000 |
Access token or user (Reader) | /api/search/universal/absolute, at most 1000 messages |
| Splunk | https://splunk.corp:8089 |
Token or user (search) | /services/search/jobs/export: stats + error examples |
| Datadog | site | API key + Application key (logs_read_data) |
Logs aggregate + events search |
| New Relic | data center | User key | NRQL FROM Log … FACET … TIMESERIES |
Observability → Add → Elasticsearch | OpenSearch | Graylog | Splunk- On a Datadog or New Relic connection: Read the run window's logs too → On.
- Test connection → Logs and load on the next run's Backend tab.
Related pages
- Observability
- Observability
In Spitfire: /observability