This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -X "POST" "https://api.logflare.app/logs?source=2fd57445-1da3-4f3b-aa29-73da06ed7e67" \ | |
| -H 'Content-Type: application/json' \ | |
| -H 'X-API-KEY: YOUR_KEY' \ | |
| -d $'{ | |
| "message": "This is another log message.", | |
| "metadata": { | |
| "ip_address": "100.100.100.100", | |
| "request_method": "POST", | |
| "custom_user_data": { | |
| "vip": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const makeid = length => { | |
| let text = "" | |
| const possible = "ABCDEFGHIJKLMNPQRSTUVWXYZ0123456789" | |
| for (let i = 0; i < length; i += 1) { | |
| text += possible.charAt(Math.floor(Math.random() * possible.length)) | |
| } | |
| return text | |
| } | |
| const buildMetadataFromHeaders = headers => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -X "POST" "https://api.logflare.app/logs?source=YOUR_SOURCE_UUID" \ | |
| -H 'Content-Type: application/json' \ | |
| -H 'X-Api-Key: YOUR_INGEST_KEY' \ | |
| -d $'{ | |
| "batch": [ | |
| { | |
| "message": "This is another log message.", | |
| "metadata": { | |
| "ip_address": "100.100.100.100", | |
| "request_method": "POST", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "logflare_worker": { | |
| "version": "1.0.2", | |
| "worker_id": "RXJD9X", | |
| "worker_started": "2021-04-13T13:36:18.848Z" | |
| }, | |
| "request": { | |
| "cf": { | |
| "asn": 15169, | |
| "clientAcceptEncoding": "gzip,deflate,br", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const sleep = ms => { | |
| return new Promise(resolve => { | |
| setTimeout(resolve, ms) | |
| }) | |
| } | |
| const makeid = length => { | |
| let text = "" | |
| const possible = "ABCDEFGHIJKLMNPQRSTUVWXYZ0123456789" | |
| for (let i = 0; i < length; i += 1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [INPUT] | |
| Name tail | |
| Path /var/log/syslog | |
| [OUTPUT] | |
| Name http | |
| Match * | |
| tls On | |
| Host api.logflare.app | |
| Port 443 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| watch -n 10 \ | |
| 'curl https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?slug=ethereum -H "X-CMC_PRO_API_KEY: CMC_KEY" -H "Accept: application/json" \ | |
| | curl -X POST --data-binary @- "https://api.logflare.app/logs/json?api_key=LOGFLARE_KEY&source=LOGFLARE_SOURCE_UUID" -H "Accept: application/json" -H "Content-Type: application/json"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Logs | |
| [sources.pg_query_log] | |
| type = "file" | |
| include = [ "/logs/postgresql.csv" ] | |
| read_from = "end" | |
| [sources.pg_query_log.multiline] | |
| start_pattern = "^20[0-9][0-9]-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9].[0-9]{3} UTC,\"" | |
| mode = "halt_before" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -X "POST" "https://api.logflare.app/api/logs?source=SOURCE_UUID" \ | |
| -H 'Content-Type: application/json' \ | |
| -H 'X-API-KEY: API_KEY' \ | |
| -d $'{ | |
| "message": "This is another log message.", | |
| "metadata": { | |
| "ip_address": "100.100.100.100", | |
| "request_method": "POST", | |
| "custom_user_data": { | |
| "vip": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const makeid = length => { | |
| let text = "" | |
| const possible = "ABCDEFGHIJKLMNPQRSTUVWXYZ0123456789" | |
| for (let i = 0; i < length; i += 1) { | |
| text += possible.charAt(Math.floor(Math.random() * possible.length)) | |
| } | |
| return text | |
| } | |
| const buildMetadataFromHeaders = headers => { |