Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
EXISTING_PG_CLUSTERS=$(kubectl get pg --all-namespaces -o json |jq '[.items[]|{name: .metadata.name}[]]')
CLUSTER_NAME_LABEL="cluster-name"
kubectl get svc --all-namespaces -l application=spilo -o json \
| jq -r --argjson EXISTING_PG_CLUSTERS "${EXISTING_PG_CLUSTERS}" \
--arg CLUSTER_NAME_LABEL "${CLUSTER_NAME_LABEL}" \
'
.items[]
@stang
stang / gmail-permalink
Created April 17, 2019 20:42 — forked from superstrong/gmail-permalink
[Browser bookmarklet] To generate a permalink to a Gmail message: (1) Open the email (2) Click "Show original (3) Run bookmarklet. You can share the search query (useful for when either party is logged into more than one Gmail account) or share the browser URL. Source: http://stackoverflow.com/questions/16827485/using-gmail-message-source-genera…
-- reference: https://docs.fluentbit.io/manual/filter/lua#callback-prototype
JSON = require("/fluent-bit/etc/JSON")
-- record["log"] comes as:
-- 'This is the first line\n{\"log\":\" and this is #2\",\"stream\":\"stdout\",\"attrs\":{\"io.kubernetes.container.name\":\"main\",\"io.kubernetes.pod.name\":\"my-pod\",\"io.kubernetes.pod.namespace\":\"dev\"},\"time\":\"2019-02-18T14:26:15.303296418Z\"}\n{\"log\":\" and this is #3\",\"stream\":\"stdout\",\"attrs\":{\"io.kubernetes.container.name\":\"main\",\"io.kubernetes.pod.name\":\"my-pod\",\"io.kubernetes.pod.namespace\":\"dev\"},\"time\":\"2019-02-18T14:26:16.303296418Z\"}\n{\"log\":\" and this is #4\",\"stream\":\"stdout\",\"attrs\":{\"io.kubernetes.container.name\":\"main\",\"io.kubernetes.pod.name\":\"my-pod\",\"io.kubernetes.pod.namespace\":\"dev\"},\"time\":\"2019-02-18T14:26:17.303296418Z\"}\n{\"log\":\" and this is #5\",\"stream\":\"stdout\",\"attrs\":{\"io.kubernetes.container.name\":\"main\",\"io.kubernetes.pod.name\":\"my-pod\",\"io.kubernetes.pod
-- -*- coding: utf-8 -*-
--
-- Source: https://raw.githubusercontent.com/jiyinyiyong/json-lua/master/JSON.lua
--
-- Simple JSON encoding and decoding in pure Lua.
--
-- Copyright 2010-2016 Jeffrey Friedl
-- http://regex.info/blog/
-- Latest version: http://regex.info/blog/lua/json
--