SlideShare a Scribd company logo
Linker Networks Corp.
http://www.linkernetworks.com
Use Raspberry Pi + Fluentd + GCP
Cloud Logging, BigQuery
as IoT Data Collect & Analysis
Simon Su @ LinkerNetworks
var simon = {/** I am at GCPUG.TW **/};
simon.GDE = 'https://developers.google.com/experts/people/peihsin-su';
simon.nodejs = ‘http://opennodes.arecord.us';
simon.googleshare = 'http://gappsnews.blogspot.tw'
simon.nodejsblog = ‘http://nodejs-in-example.blogspot.tw';
simon.blog = ‘http://peihsinsu.blogspot.com';
simon.slideshare = ‘http://slideshare.net/peihsinsu/';
simon.email = ‘simonsu.mail@gmail.com’;
simon.say(‘Let’s go Cloud!');
Welcome to join us!
What we use...
● Docker
● Fluentd
● Google Cloud Logging
● Google BigQuery
● SpreadSheet
Docker
● Build, Ship and Run any
App, Anywhere
● DevOps spirit
● Fast to scale
Fluentd
● Easy and fast
● Message delivery for at
most once, at least
once, exactly once
BigQuery
● TB Level data analysis
● Fast mining tool
● SQL like interface
● Multi-dataset join support
● Cheap & Pay by Use
Google BigQuery - Big data with SQL like query feature, but fast...
Cloud Logging
Architecture
● BigQuery: Data Warehouse and
support query and analysis
● Cloud Logging: Log gateway
and easy to transfer to one or
multi destination with guarantee
● Fluentd: Device layer gateway
and support multi source for
user to extend http(s) input
tcp/udp input
forward / secure forward
other inputs
● Customize schema
● Co-relation
● Higher quota and
performance
● Web console
● Export available for BQ,
GCS, Pub/Sub
● Configure input source
Prepare Log Gateway using
Cloud Logging
Still no GCP project?? (https://cloud.google.com/free-trial/)
curl -sSO https://dl.google.com/cloudagents/install-logging-agent.sh
sudo bash install-logging-agent.sh
service google-fluentd start
Install Cloud Log Agent From: https://cloud.google.com/logging/docs/agent/installation
Configure
# /etc/google-fluentd/google-fluentd.conf
<source>
type http
port 9880
</source>
<source>
@type forward
port 24224
</source>
<filter *.**>
@type stdout
</filter>
# Do not collect fluentd's own logs to avoid infinite loops.
<match fluent.**>
type null
</match>
# Configure all sources to output to Google Cloud Logging
<match *.**>
type google_cloud
# Set the chunk limit conservatively to avoid exceeding the limit
# of 10MB per write request.
buffer_chunk_limit 2M
flush_interval 5s
# Never wait longer than 5 minutes between retries.
max_retry_wait 300
# Disable the limit on the number of retries (retry forever).
disable_retry_limit
# Use multiple threads for processing.
num_threads 8
</match>
Set config to open fluentd forward
and also screen output for debug..
Test run & watch log...
# service google-fluentd start
# tail -f /var/log/google-fluentd/google-fluentd.log
2016-09-02 09:46:44 +0000 hddusage.simon-project.a_54ERXdr4inKCGiAAAA:
{"catg":"hddusage","ctime":null,"size":null,"used":null,"avail":null,"use":null,"linker_devid":"simon-project.a_54ERXdr4inKCGiAAAA"}
2016-09-02 09:46:44 +0000 hddusage.simon-project.a_54ERXdr4inKCGiAAAA:
{"catg":"hddusage","ctime":null,"size":null,"used":null,"avail":null,"use":null,"linker_devid":"simon-project.a_54ERXdr4inKCGiAAAA"}
2016-09-02 09:46:44 +0000 hddusage.simon-project.a_54ERXdr4inKCGiAAAA:
{"catg":"hddusage","ctime":null,"size":null,"used":null,"avail":null,"use":null,"linker_devid":"simon-project.a_54ERXdr4inKCGiAAAA"}
….(skip)
Prepare a Docker enabled Pi
Install Docker into Fluentd
http://blog.hypriot.com/downloads/
Build the Fluentd Docker for Pi
Getting start with fluentd… (https://peihsinsu.gitbooks.io/fluentd-in-action/content/)
Build your Raspberry Pi Fluentd - Dockerfile
# Dockerfile
FROM hypriot/rpi-alpine-scratch
MAINTAINER linkeriot
RUN adduser -D -g '' -u 1000 docker
ENV FLUENTD_VERSION 0.14
RUN apk --update add 
build-base 
ca-certificates 
ruby-dev 
&& 
rm -rf /var/cache/apk/* && 
echo 'gem: --no-document' >> /etc/gemrc && 
gem install fluentd -v $FLUENTD_VERSION && 
apk del build-base
WORKDIR /fluentd
RUN mkdir log etc plugins config.d
COPY fluent.conf /fluentd/etc/
ONBUILD COPY fluent.conf /fluentd/etc/
ONBUILD COPY plugins/* /fluentd/plugins/
ENV FLUENTD_OPT=""
ENV FLUENTD_CONF="fluent.conf"
EXPOSE 24224
EXPOSE 8888
VOLUME ["/fluentd/log"]
CMD fluentd -c /fluentd/etc/$FLUENTD_CONF -p /fluentd/plugins $FLUENTD_OPT
Build your Raspberry Pi Fluentd - fluentd.conf
# fluentd.conf
@include /fluentd/config.d/*.conf
<label @mainstream>
<filter **>
@type record_transformer
<record>
linker_devid "#{ENV['TAG']}"
</record>
</filter>
<match **>
@type forward
send_timeout 60s
recover_wait 10s
heartbeat_interval 1s
phi_threshold 16
hard_timeout 60s
<server>
name loggateway
host "#{ENV['FDN']}"
port "#{ENV['FPORT']}"
weight 60
</server>
<secondary>
@type file
path /var/log/fluent/forward-failed
</secondary>
</match>
</label>
Build and publish
● docker build -t your-image-name .
● docker push your-image-name
Run the Docker...
Run from your images
docker run -d -p 24224:24224 --restart=always 
-e FDN=[remote-server-ip] 
-e FPORT=[remote-server-port] 
-e TAG=[your-tag] 
-v /var/log:/fluentd/log 
-v /data/cfg:/fluentd/config.d 
yout-image-name
Run using linker build images
docker run -d -p 24224:24224 --restart=always 
-e FDN=[remote-server-ip] 
-e FPORT=[remote-server-port] 
-e TAG=[your-tag] 
-v /var/log:/fluentd/log 
-v /data/cfg:/fluentd/config.d 
linkeriot/iot-log-agent
Set log forward to BigQuery
Check log insert status...
Enable log forward to BigQuery...
BigQuery from SpreadSheet
Try your query….
Create Apps Script from Google SpreadSheet
Using my sample...
Get source from gist: http://goo.gl/J90QD6
Test run the script
Setup the schedule...
Create the chart...
The End
Q&A

More Related Content

PDF
Google Cloud Computing compares GCE, GAE and GKE
PDF
JCConf 2016 - Google Dataflow 小試
PDF
JCConf 2015 - Google Dataflow 在雲端大資料處理的應用
PDF
GCPUG.TW - GCP學習資源分享
PDF
Google Cloud Platform Special Training
PDF
Google Cloud Dataflow meets TensorFlow
PDF
Google compute engine - overview
PDF
node.js on Google Compute Engine
Google Cloud Computing compares GCE, GAE and GKE
JCConf 2016 - Google Dataflow 小試
JCConf 2015 - Google Dataflow 在雲端大資料處理的應用
GCPUG.TW - GCP學習資源分享
Google Cloud Platform Special Training
Google Cloud Dataflow meets TensorFlow
Google compute engine - overview
node.js on Google Compute Engine

What's hot (20)

PPTX
Google Cloud Platform - Eric Johnson, Joe Selman - ManageIQ Design Summit 2016
PDF
How to make GAE adapt the Great Firewall
PDF
Hands on App Engine
PDF
JCConf 2016 - Dataflow Workshop Labs
PDF
PuppetConf 2017: Zero to Kubernetes -Scott Coulton, Puppet
PDF
Getting started with Google Cloud Training Material - 2018
PPTX
Using Google App Engine Python
PDF
PuppetConf 2017: Cloud, Containers, Puppet and You- Carl Caum, Puppet
PDF
TensorFlow on GCP
PDF
Google Cloud: Data Analysis and Machine Learningn Technologies
PPTX
Intro to the Google Cloud for Developers
PDF
Through the looking glass an intro to scalable, distributed counting in data...
PDF
Firebase Cloud Functions: a quick overview
PDF
Kubernetes & Google Container Engine @ mabl
PDF
Tooling Matters - Development tools
PDF
Google Cloud DNS
PDF
Embracing Serverless with Google
PPTX
[GCP Summit 2018] Kubernetes with Nginx and Elasticsearch on GCP
PDF
Building a Data Pipeline using Apache Airflow (on AWS / GCP)
PDF
Azure containers fundamentals
Google Cloud Platform - Eric Johnson, Joe Selman - ManageIQ Design Summit 2016
How to make GAE adapt the Great Firewall
Hands on App Engine
JCConf 2016 - Dataflow Workshop Labs
PuppetConf 2017: Zero to Kubernetes -Scott Coulton, Puppet
Getting started with Google Cloud Training Material - 2018
Using Google App Engine Python
PuppetConf 2017: Cloud, Containers, Puppet and You- Carl Caum, Puppet
TensorFlow on GCP
Google Cloud: Data Analysis and Machine Learningn Technologies
Intro to the Google Cloud for Developers
Through the looking glass an intro to scalable, distributed counting in data...
Firebase Cloud Functions: a quick overview
Kubernetes & Google Container Engine @ mabl
Tooling Matters - Development tools
Google Cloud DNS
Embracing Serverless with Google
[GCP Summit 2018] Kubernetes with Nginx and Elasticsearch on GCP
Building a Data Pipeline using Apache Airflow (on AWS / GCP)
Azure containers fundamentals
Ad

Viewers also liked (20)

PDF
Brocade - Stingray Application Firewall
PDF
GCPUG meetup 201610 - Dataflow Introduction
PDF
GCPNext17' Extend 開始GCP了嗎?
PDF
Lambda Architecture using Google Cloud plus Apps
PPT
Logs for Incident Response and Forensics: Key Issues for GOVCERT.NL 2008
PDF
Unifying Events and Logs into the Cloud
PPTX
Using raspberry pi to capture environmental factors that affect sleep
PPTX
2014 AWS Re:Invent sharing
PDF
Play’n’Learn: A Continuous KM Improvement Approach using FSM methods
PDF
Docker in Action
PDF
Google I/O Extended 2016 - 台北場活動回顧
PPTX
Data Donderdag - Making your own smart ‘machine learning’ thermostat
PPTX
Log Management and Analysis for Cloud Applications
PDF
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(下)
PDF
Google I/O 2016 Recap - Google Cloud Platform News Update
PDF
中原大學 Shift to cloud
PDF
GCPUG.TW - 2016活動討論
PDF
技術單兵作戰及團隊開發流程差異
PDF
Developer team review of 2014
PDF
中華電信 教育訓練
Brocade - Stingray Application Firewall
GCPUG meetup 201610 - Dataflow Introduction
GCPNext17' Extend 開始GCP了嗎?
Lambda Architecture using Google Cloud plus Apps
Logs for Incident Response and Forensics: Key Issues for GOVCERT.NL 2008
Unifying Events and Logs into the Cloud
Using raspberry pi to capture environmental factors that affect sleep
2014 AWS Re:Invent sharing
Play’n’Learn: A Continuous KM Improvement Approach using FSM methods
Docker in Action
Google I/O Extended 2016 - 台北場活動回顧
Data Donderdag - Making your own smart ‘machine learning’ thermostat
Log Management and Analysis for Cloud Applications
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(下)
Google I/O 2016 Recap - Google Cloud Platform News Update
中原大學 Shift to cloud
GCPUG.TW - 2016活動討論
技術單兵作戰及團隊開發流程差異
Developer team review of 2014
中華電信 教育訓練
Ad

Similar to 使用 Raspberry pi + fluentd + gcp cloud logging, big query 做iot 資料搜集與分析 (20)

PDF
Hadoop Conf 2014 - Hadoop BigQuery Connector
PDF
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
PDF
Serverless? How (not) to develop, deploy and operate serverless applications.
PDF
Introduction to the IBM Watson Data Platform
PDF
From localhost to the cloud: A Journey of Deployments
PDF
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源
PDF
Gaming analytics on gcp
PDF
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
PDF
CloudOps CloudStack Days, Austin April 2015
PDF
Visualising and Linking Open Data from Multiple Sources
PDF
Connecting and Visualising Open Data from Multiple Sources
PDF
Digital Forensics and Incident Response in The Cloud
PPTX
Developing with the Go client for Apache Kafka
PDF
Beyond Puppet
PDF
There is something about serverless
KEY
WebGL Awesomeness
ODP
Building a Dev/Test Cloud with Apache CloudStack
PDF
GCP Gaming 2016 Seoul, Korea Gaming Analytics
PDF
wotxr-20190320rzr
PDF
Frontend SPOF
Hadoop Conf 2014 - Hadoop BigQuery Connector
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
Serverless? How (not) to develop, deploy and operate serverless applications.
Introduction to the IBM Watson Data Platform
From localhost to the cloud: A Journey of Deployments
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源
Gaming analytics on gcp
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
CloudOps CloudStack Days, Austin April 2015
Visualising and Linking Open Data from Multiple Sources
Connecting and Visualising Open Data from Multiple Sources
Digital Forensics and Incident Response in The Cloud
Developing with the Go client for Apache Kafka
Beyond Puppet
There is something about serverless
WebGL Awesomeness
Building a Dev/Test Cloud with Apache CloudStack
GCP Gaming 2016 Seoul, Korea Gaming Analytics
wotxr-20190320rzr
Frontend SPOF

More from Simon Su (16)

PDF
Kubernetes Basic Operation
PDF
Google IoT Core 初體驗
PDF
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
PDF
GCPUG.TW meetup #28 - GKE上運作您的k8s服務
PDF
GCE Windows Serial Console Usage Guide
PDF
Try Cloud Spanner
PDF
Google Cloud Monitoring
PDF
JCConf2016 - Dataflow Workshop Setup
PDF
IThome DevOps Summit - IoT、docker與DevOps
PDF
Google Cloud Platform Introduction - 2016Q3
PPTX
GCS - Access Control Lists (中文)
PDF
Google Cloud Platform - for Mobile Solutions
PDF
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(上)
PDF
GCPUG.TW - 2015活動回顧
PDF
CouchDB Getting Start
PDF
Google Cloud Platform專案建立說明
Kubernetes Basic Operation
Google IoT Core 初體驗
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
GCPUG.TW meetup #28 - GKE上運作您的k8s服務
GCE Windows Serial Console Usage Guide
Try Cloud Spanner
Google Cloud Monitoring
JCConf2016 - Dataflow Workshop Setup
IThome DevOps Summit - IoT、docker與DevOps
Google Cloud Platform Introduction - 2016Q3
GCS - Access Control Lists (中文)
Google Cloud Platform - for Mobile Solutions
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(上)
GCPUG.TW - 2015活動回顧
CouchDB Getting Start
Google Cloud Platform專案建立說明

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
KodekX | Application Modernization Development
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPT
Teaching material agriculture food technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Cloud computing and distributed systems.
Chapter 3 Spatial Domain Image Processing.pdf
Modernizing your data center with Dell and AMD
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
KodekX | Application Modernization Development
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Teaching material agriculture food technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Advanced methodologies resolving dimensionality complications for autism neur...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
NewMind AI Weekly Chronicles - August'25 Week I
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Big Data Technologies - Introduction.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Cloud computing and distributed systems.

使用 Raspberry pi + fluentd + gcp cloud logging, big query 做iot 資料搜集與分析

  • 1. Linker Networks Corp. http://www.linkernetworks.com Use Raspberry Pi + Fluentd + GCP Cloud Logging, BigQuery as IoT Data Collect & Analysis Simon Su @ LinkerNetworks
  • 2. var simon = {/** I am at GCPUG.TW **/}; simon.GDE = 'https://developers.google.com/experts/people/peihsin-su'; simon.nodejs = ‘http://opennodes.arecord.us'; simon.googleshare = 'http://gappsnews.blogspot.tw' simon.nodejsblog = ‘http://nodejs-in-example.blogspot.tw'; simon.blog = ‘http://peihsinsu.blogspot.com'; simon.slideshare = ‘http://slideshare.net/peihsinsu/'; simon.email = ‘simonsu.mail@gmail.com’; simon.say(‘Let’s go Cloud!');
  • 4. What we use... ● Docker ● Fluentd ● Google Cloud Logging ● Google BigQuery ● SpreadSheet
  • 5. Docker ● Build, Ship and Run any App, Anywhere ● DevOps spirit ● Fast to scale
  • 6. Fluentd ● Easy and fast ● Message delivery for at most once, at least once, exactly once
  • 7. BigQuery ● TB Level data analysis ● Fast mining tool ● SQL like interface ● Multi-dataset join support ● Cheap & Pay by Use Google BigQuery - Big data with SQL like query feature, but fast...
  • 9. Architecture ● BigQuery: Data Warehouse and support query and analysis ● Cloud Logging: Log gateway and easy to transfer to one or multi destination with guarantee ● Fluentd: Device layer gateway and support multi source for user to extend http(s) input tcp/udp input forward / secure forward other inputs ● Customize schema ● Co-relation ● Higher quota and performance ● Web console ● Export available for BQ, GCS, Pub/Sub ● Configure input source
  • 10. Prepare Log Gateway using Cloud Logging
  • 11. Still no GCP project?? (https://cloud.google.com/free-trial/)
  • 12. curl -sSO https://dl.google.com/cloudagents/install-logging-agent.sh sudo bash install-logging-agent.sh service google-fluentd start Install Cloud Log Agent From: https://cloud.google.com/logging/docs/agent/installation
  • 13. Configure # /etc/google-fluentd/google-fluentd.conf <source> type http port 9880 </source> <source> @type forward port 24224 </source> <filter *.**> @type stdout </filter> # Do not collect fluentd's own logs to avoid infinite loops. <match fluent.**> type null </match> # Configure all sources to output to Google Cloud Logging <match *.**> type google_cloud # Set the chunk limit conservatively to avoid exceeding the limit # of 10MB per write request. buffer_chunk_limit 2M flush_interval 5s # Never wait longer than 5 minutes between retries. max_retry_wait 300 # Disable the limit on the number of retries (retry forever). disable_retry_limit # Use multiple threads for processing. num_threads 8 </match> Set config to open fluentd forward and also screen output for debug..
  • 14. Test run & watch log... # service google-fluentd start # tail -f /var/log/google-fluentd/google-fluentd.log 2016-09-02 09:46:44 +0000 hddusage.simon-project.a_54ERXdr4inKCGiAAAA: {"catg":"hddusage","ctime":null,"size":null,"used":null,"avail":null,"use":null,"linker_devid":"simon-project.a_54ERXdr4inKCGiAAAA"} 2016-09-02 09:46:44 +0000 hddusage.simon-project.a_54ERXdr4inKCGiAAAA: {"catg":"hddusage","ctime":null,"size":null,"used":null,"avail":null,"use":null,"linker_devid":"simon-project.a_54ERXdr4inKCGiAAAA"} 2016-09-02 09:46:44 +0000 hddusage.simon-project.a_54ERXdr4inKCGiAAAA: {"catg":"hddusage","ctime":null,"size":null,"used":null,"avail":null,"use":null,"linker_devid":"simon-project.a_54ERXdr4inKCGiAAAA"} ….(skip)
  • 15. Prepare a Docker enabled Pi
  • 16. Install Docker into Fluentd http://blog.hypriot.com/downloads/
  • 17. Build the Fluentd Docker for Pi
  • 18. Getting start with fluentd… (https://peihsinsu.gitbooks.io/fluentd-in-action/content/)
  • 19. Build your Raspberry Pi Fluentd - Dockerfile # Dockerfile FROM hypriot/rpi-alpine-scratch MAINTAINER linkeriot RUN adduser -D -g '' -u 1000 docker ENV FLUENTD_VERSION 0.14 RUN apk --update add build-base ca-certificates ruby-dev && rm -rf /var/cache/apk/* && echo 'gem: --no-document' >> /etc/gemrc && gem install fluentd -v $FLUENTD_VERSION && apk del build-base WORKDIR /fluentd RUN mkdir log etc plugins config.d COPY fluent.conf /fluentd/etc/ ONBUILD COPY fluent.conf /fluentd/etc/ ONBUILD COPY plugins/* /fluentd/plugins/ ENV FLUENTD_OPT="" ENV FLUENTD_CONF="fluent.conf" EXPOSE 24224 EXPOSE 8888 VOLUME ["/fluentd/log"] CMD fluentd -c /fluentd/etc/$FLUENTD_CONF -p /fluentd/plugins $FLUENTD_OPT
  • 20. Build your Raspberry Pi Fluentd - fluentd.conf # fluentd.conf @include /fluentd/config.d/*.conf <label @mainstream> <filter **> @type record_transformer <record> linker_devid "#{ENV['TAG']}" </record> </filter> <match **> @type forward send_timeout 60s recover_wait 10s heartbeat_interval 1s phi_threshold 16 hard_timeout 60s <server> name loggateway host "#{ENV['FDN']}" port "#{ENV['FPORT']}" weight 60 </server> <secondary> @type file path /var/log/fluent/forward-failed </secondary> </match> </label>
  • 21. Build and publish ● docker build -t your-image-name . ● docker push your-image-name
  • 23. Run from your images docker run -d -p 24224:24224 --restart=always -e FDN=[remote-server-ip] -e FPORT=[remote-server-port] -e TAG=[your-tag] -v /var/log:/fluentd/log -v /data/cfg:/fluentd/config.d yout-image-name
  • 24. Run using linker build images docker run -d -p 24224:24224 --restart=always -e FDN=[remote-server-ip] -e FPORT=[remote-server-port] -e TAG=[your-tag] -v /var/log:/fluentd/log -v /data/cfg:/fluentd/config.d linkeriot/iot-log-agent
  • 25. Set log forward to BigQuery
  • 26. Check log insert status...
  • 27. Enable log forward to BigQuery...
  • 30. Create Apps Script from Google SpreadSheet
  • 31. Using my sample... Get source from gist: http://goo.gl/J90QD6
  • 32. Test run the script