Server with Splunk Logging
The example at /docs/src/examples/splunk runs a Deno server script as a continuously monitored and restarted process, logging all output to Splunk using the splunk-hec plugin.
Note: If you're connecting to a Splunk HEC server with a bad certificate, such as during testing, you'll need to start pup manually with the
--unsafely-ignore-certificate-errorsflag. The full command for this would be
deno run -Ar --unsafely-ignore-certificate-errors https://deno.land/x/pup/pup.ts run
- pup.jsonc - Pup configuration, sets up
server.jsto be kept alive forever and enables the Splunk HEC plugin for logging.
- server.js - Fake server, prints the value of env.TZ to demonstrate custom environment variables, runs for 10 seconds, then exits, to demonstrate restart behavior.
The HEC token can be configured in the
pup.jsonc configuration file as shown in the example configuration, or by using the environment variable
Start the example by running
pup run if pup is installed, or something like
deno run -A ../../../pup.ts run if not.