This file contains 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
SELECT | |
count(t0.id) as count, | |
f2.path as path | |
FROM | |
edge_logs AS t0 | |
INNER JOIN UNNEST(t0.metadata) AS f1 ON TRUE | |
INNER JOIN UNNEST(f1.request) AS f2 ON TRUE | |
INNER JOIN UNNEST(f2.headers) AS f3 ON TRUE | |
WHERE | |
AND (REGEXP_CONTAINS(f3.user_agent, 'ChatGPT-User')) |
This file contains 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
Enum.each(Process.list, fn pid -> | |
case Process.info(pid)[:dictionary] do | |
[_, "$initial_call": {:supervisor, DBConnection.ConnectionPool.Pool, _}] -> | |
state = :sys.get_state(pid, 5000) | |
case elem(state, 11) do | |
{pid, _, Postgrex.Protocol, opts} -> | |
if opts[:hostname] == "db.REDACTED.supabase.co" do | |
IO.inspect({pid, state}) | |
end | |
_ -> nil |
This file contains 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/json?source=SOURCE_UUID" \ | |
-H 'Content-Type: application/json; charset=utf-8' \ | |
-H 'X-API-KEY: YOUR_API_KEY' \ | |
-d $'[ | |
{ | |
"yellow": true, | |
"tags": [ | |
"popular, tropical, organic" | |
], | |
"store": { |
This file contains 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=YOUR_SOURCE_UUID" \ | |
-H 'Content-Type: application/json' \ | |
-H 'X-Api-Key: YOUR_INGEST_API_KEY' \ | |
-d $'{ | |
"batch": [ | |
{ | |
"message": "A human readable event message!", | |
"metadata": { | |
"ip_address": "1.2.3.4", | |
"datacenter": "aws", |
This file contains 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
addEventListener("fetch", event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
async function handleRequest(request) { | |
const token = getJwt(request) | |
const payload = get_payload(token) |
This file contains 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 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 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 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 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 |
NewerOlder