This benthos plugin provides a simple way to output to a google spreadsheet.
For this plugin to work you will need to get a service account credential from google cloud.
- Create a service account https://console.cloud.google.com/identity/serviceaccounts/create with the
Project -> Editor
role. - Create a key for the service account, download it and save it.
- Create a new sheet if you don't have it already.
- Share the sheet with your new service-account email as an editor.
Clone the project and after doing the steps above you need to define the GOOGLE_APPLICATION_CREDENTIALS
environment variable in your terminal.
You can do this by entering the command bellow in your terminal
export GOOGLE_APPLICATION_CREDENTIALS="<path to your service account key>
Now let's run the example provided in the repository.
- Install deps
go mod vendor
- Replace the sheetId in
examples/stdin.yaml
with your sheet id found in the url. - Run
make run
and enter{"field1": "test1", "field2": "test2"}
in the running process. - You should now see one row with
test1,test2
- Thats it.
For now the configuration is pretty simple.
output:
type: sheets
plugin:
sheetId: "1z5W9eXXzr9fG0lYcTtXSgtYfnusIPCuAIomsZvhkO5s"
We use helm to deploy our containers with that we provide a chart for deploying your first processor to sheets.
- Clone this repository
- Edit the
values.yaml
value to your needs - Obtain a google service account like said above and create a secret in the same namespace you are deploying
kubectl create secret generic google-service-account --from-file=sva.json=/path/to/svc-key.json -n processors
- Install the chart
helm install myprocessor chart/ -f values.yaml -n processors
- Done
Hugo Fonseca [email protected]
MIT