Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boynet/cf-logdna-worker
simple cloudflare worker recipe to send logs into logdna
https://github.com/boynet/cf-logdna-worker
Last synced: 17 days ago
JSON representation
simple cloudflare worker recipe to send logs into logdna
- Host: GitHub
- URL: https://github.com/boynet/cf-logdna-worker
- Owner: boynet
- License: unlicense
- Created: 2018-10-24T15:10:28.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-23T07:09:57.000Z (almost 4 years ago)
- Last Synced: 2024-08-01T16:34:39.802Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 26
- Watchers: 5
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cloudflare - Send Logs to Logdna - Simple recipe to send logs to logdna. (Workers / Recipes)
- awesome-cloudflare - Send Logs to Logdna - Simple recipe to send logs to logdna. (Workers / Recipes)
README
# cf-dnalog-worker
simple cloudflare worker recipe to send logs into [logdna](https://logdna.com/)## how to use
copy index.js content into your worker
change myApp and myHostName into whatever you want, read the logdna [Ingest API](https://docs.logdna.com/v1.0/reference#api)* maxRequestsPerBatch - how many requests to maximum batch per sending, by default it send all the batched requests once per 10 seconds
## about compiledPass
you should precompile your logdna ingestion key and store it in the compilePass parameters, you can simply type in console `btoa(username+':'+password)` where username is your ingestion key and password keep empty, and put the results into the parameter to save some cpu time(probably)
I left all the console.log command to better help you debug
### logged parameters:
+ user agent
+ referer
+ ip
+ countryCode
+ url
+ colo
+ workerInception
+ workerId
+ method
+ x_forwarded_for
+ asn
+ status
+ originTime
+ CF-Cache-Status
+ CF-Ray
+ tlsCipher
+ tlsVersion
+ clientTrustScore