I wrote something similar that will send stdin to Google Stackdriver Logging.
For example, this uses datamash (https://www.gnu.org/software/datamash/) to sum column 2 of a CSV ("-t,"), then log the output:
datamash -t, sum 2 < stuff.csv | loggerBonus: In depth code review for this package: https://youtu.be/c5ufcpTGIJM