06 Aug 2024 02:26 PM - last edited on 08 Aug 2024 12:25 PM by andre_vdveen
I have been researching this and wanted to know if anyone has setup log ingestion rules for a file share that is not attached to a pc. We have software that writes its logs to a NFS share drive, however these shares are not attached to the PC, they are browsable from the host.
I assume the one agent need to be able to see the share location somehow, essentially the location to ingest logs will be something like \\hostname\testLogs\test.json
any documentation or guidance will be appreciated.
Solved! Go to Solution.
07 Aug 2024 08:57 AM - edited 07 Aug 2024 09:00 AM
The Dynatrace OpenTelemetry collector distribution includes two components I think may help here. The filelog receiver (point it at the network share?) and the syslog receiver (if you're looking at syslog formatted data?)
config.yaml
receivers: filelog: include: - \\dcptest01\testLogs\*.json
processors:
transform/add_timestamps:
error_mode: ignore
log_statements:
- context: string
statements:
- set(observed_time, Now())
- set(time, Now())
exporters:
otlphttp/dynatrace:
endpoint: "$DT_ENDPOINT/api/v2/otlp"
headers:
Authorization: "Api-Token $DT_API_TOKEN"
service:
pipelines:
logs:
receivers: [filelog]
processors: [transform/add_timestamps]
exporters: [otlphttp/dynatrace]
Then run it in any way you like (Kubernetes cluster, standalone binary on the host, docker etc.)
// Example running as a standalone binary
export DT_ENDPOINT=https://abc12345.live.dynatrace.com
export DT_API_TOKEN=dt0c01.****.**** // This token has logs.ingest permissions
./dynatrace-otel-collector --config=config.yaml