Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Making Logs Work for you
with Fluentd
Phil Wilkins
Technology Evangelist
Oracle Ace Director
uk.linkedin.com/in/philWilkins
@PhilAtCapgemini /
@MP3Monster
Oracle-integration.cloud /
APIPlatform.cloud /
Blog.mp3monster.org
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
The About Me …
Me in 5:
• Husband, Father, Blogger & Author
• Technical Architect, Tech Evangelist
• Work for Capgemini UK as part of a
multi award winning team
• Work with primarily open source +
Oracle cloud & middleware
• Know more – mp3monster.org
https://www.manning.com/
books/logging-in-action
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Capgemini is One of the World's Largest Consulting,
Technology, and Outsourcing Firms & a global “full
service” business transformation provider
Group Workforce: 200,000+ Globally
Asia Pacific
Latin America
Canada
United States
Mexico
Brazil
Argentina
Europe
Morocco
Australia
People’s Republic of China
India
Chile
Guatemala
Russia
Singapore
Hong Kong
North
America
UK & Ireland
Nordics
Benelux
“It is the quality of our people, and their
capacity to deliver fitting solutions, with you
and for you, that drive real business results.”
Across 40+ countries, 100 nationalities
5Businesses
Revenue
12,8
Billion EUR (2017)
Central Europe
Morocco
Net Profit
€1,18B
 Targeting Value
 Mitigating Risk
 Optimising
Capabilities
 Aligning the
Organisation
Elements to
successful
collaboration
Application Services
Infrastructure
Services
Business Process
Outsourcing
Consulting
(Capgemini Consulting)
Local Professional
4
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Putting Monitoring & Log Analytics
into Perspective
Host / Infrastructure
Monitoring
Virtualization /
Container Monitoring
Application Monitoring
Business Application
Monitoring
Security
/
SIEM
Capacity
Monitoring
Metrics – Typically
Numerical (sample based
data e.g. CPU use)
Logs Textual (event based
data e.g. app logging,
SNMP traps)
Observability Pillars / Key
Traces (execution flow &
timing – transaction
based, sampled)
Cambridge English Dictionary definition of
Monitor:
to look at something for a period of time,
especially something that is changing or moving
Observe:
to watch carefully the way something happens or
the way someone does something, especially in
order to learn more about it
The idea that there are 3 Pillars of
Observability has been around for a while:
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Application of Logs
• Spotting unexpected errors
• performance issues
• Who did what & when
• Blend for end to end picture
• What is happening and how does it
impact our business!!
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Increasing Complexity of End to End
Solutions
Evolution
Sophistication
/
Complexity
Apache
Tomcat /
Servlets
Async BEPL in
Clustered SOA
Async BEPL in
Clustered SOA +
JMS multi-
consumer
Node.js /
Kafka
consumer
s
Purist
Containerized
Microservices
/ Function as
a Service
OSB
Sync Flows in
SOA
No
Concurrency
Concurrency
through threads –
1 thread ran the
transaction
Asynchronous
Concurrency
(thread sharing /
reactive models)
Distributed
Concurrency
Modern
Development
Techniques
SOA /
Service Bus
Techniques
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Highly Pluggable Framework
Input
• TCP/UDP
• Unix Sockets
• HTTP
• Many file formats
• SNMP traps
• OS (Linux/UNIX)
• Log4J, SLF4J and other related
frameworks for .Net, JavaScript
Output
• ALM solutions e.g. Splunk, cloud native
solutions, loggly, logzio etc.
• HTTP
• Prometheus
• Grafana
• Many file formats
• DB (SQL/NoSQL)
• Event Streams e.g. Kafka, SS, Kenesis, MQTT
• Social notifications e.g. Jabber, Slack, emai,
twilio l etc
• Support mgmt tools like pagerduty
Buffer /
Cache
• Custom in memory cache
• Redis
Storage
• S3 buckets
• Db
• Redis
Formatter
• XML
• JSON
• CSV/TSV etc.
• Compressed formats
Parser
• Multline text to single event
• Event info extraction e.g. date & time
Filters
• Value based conditions
• REGEX expressions
Custom components
Amusing Ruby Gems it is possible to build
any custom components using the framework
provided
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
• e.g. myInput
• Logical name defined by source
definition
Tag
• e.g. 1362050500.000000000
• Defined by time into Fluentd unless
mapped from received event
TimeStamp
• e.g. {“doYou” : “believe”, “this” :
“content” }
• Can be received as anything but
treated as a JSON object
Record
Log Event Make Up
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Data to Actionable Information
Information
Source Capture
• Infra structure such as
CPU, memory use
• JVM use
• App Log Files
• SNMP Traps
Structure
& Route
• Get the raw data
to the
appropriate
tooling in a
format that can
be processed
Aggregate &
Analyze
•Data from
multiple sources
•Merge in time
series
Visualize
Data
• Search for log
events
• Present trends
e.g. memory
consumption,
• Rate of storage
consumption
Notify &
Alert
•Push events
into JIRA Svc
Desk, Slack, etc
•Rules on
severity dictate
behaviours
Fluentd – Optimal
Fluentd – Leverage Other Tools
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
ELK / EFK Logging Stacks
Log
Aggregation
/ Unification
Analytics
& Search
Visualization
Kibana
Elastic Search
Logstash Beats
(Lightweight
variant)
ELK
Elastic Search
Kibana
Fluent Bit
(Lightweight
variant)
Fluentd
EFK
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Central Node (Node 2)
(Single Instance)
Node 1
(Instance n)
Multi Node Demo
• Transsform (event 
message)
• Match + copy:
• Out file
• relabel
labelPipeline
basic-file.txt
basic-file2.txt
label-pipeline-file-output.*
forwarder
common
• filter
Slack
Stdout /
Monitoring
Warboard
Op Analytics
filters
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Central Node (Node 2)
(Single Instance)
Node 1
(Instance n)
Multi Node Demo
• Transsform (event 
message)
• Match + copy:
• Out file
• relabel
labelPipeline
basic-file.txt
basic-file2.txt
label-pipeline-file-output.*
forwarder
common
• filter
Slack
stdout
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Fluentd Config Example – Node 1
<system>
Log_Level info
</system>
#### begin - tail basic file
<source>
@type tail
path ./Chapter6/basic-file.txt
read_lines_limit 5
tag basicFile
pos_file ./Chapter6/basic-file-read.pos_file
read_from_head true
<parse>
@type json
</parse>
@label labelPipeline
</source>
#### end - file 1
#### begin - tail basic-file2
<source>
@type tail
path ./Chapter6/basic-file2.txt
read_lines_limit 5
tag basicFILE2
pos_file ./Chapter6/basic-file-
read2.pos_file
read_from_head true
<parse>
@type json
</parse>
@label forwarder
</source>
#### end - tail basic-file2
<label labelPipeline>
align naming
<filter *>
@type record_transformer
<record>
message ${record["event"]}
transformed yes
event -
</record>
</filter>
#### begin - file out 1
<match *>
@type copy
<store>
@type file
path ./Chapter6/label-pipeline-file-output
<buffer>
delayed_commit_timeout 10
flush_at_shutdown true
chunk_limit_records 50
flush_interval 15
flush_mode interval
</buffer>
<format>
@type out_file
delimiter comma
output_tag true
</format>
</store>
<store>
@type relabel
@label forwarder
</store>
</match>
</label>
<label forwarder>
<match *>
@type forward
buffer_type memory
flush_interval 5s
<server>
host 127.0.0.1
port 28080
</server>
</match>
</label>
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Fluentd Config Example – Node 2
<system>
Log_Level info
</system>
<source>
@type forward
port 28080
bind 0.0.0.0
@label common
</source>
#### begin -
for log events with the label common
<label common>
#<filter *>
# @type stdout
#</filter>
<filter *>
@type grep
<regexp>
key message
pattern /omputer/
</regexp>
</filter>
<filter *>
@type stdout
</filter>
<match *>
@type slack
token xoxb-xyz1234567890
username me
icon_emoji :ghost: # if you don't want to use
icon_url, delete this param.
channel general
message Node2 says - %s
message_keys message
title %s
title_keys tag
flush_interval 1s
time_key time
</match>
</label>
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Fluentd Config Example – Test Tool Config
SOURCE=.testDatamedium-source.txt
TARGETFILE=./Demo/basic-file.txt
#%t (+1 or timestamp format %l = log level e.
g. DEBUG %c class e.g. demo.code.com %p proc
ess or thread id %m mlog message
SOURCEFORMAT=%t %m
TARGETFORMAT={"source":"basicFile", "event":"%
m", "cycle":%i}
OUTPUTTYPE=file
DEFAULT-PROPCESS=Thread-1
DEFAULT-LOCATION=com.demo
DEFAULT-LOGLEVEL=INFO
REPEAT=5
VERBOSE=true
SOURCE=.testDatasmall-fact-source.txt
TARGETFILE=./Demo/basic-file2.txt
#%t (+1 or timestamp format %l = log level e.g.
DEBUG %c class e.g. demo.code.com %p process or
thread id %m mlog message
SOURCEFORMAT=%t %m
TARGETFORMAT={"message":"%m", "stream":"basicFILE
2", "iter":%i}
OUTPUTTYPE=file
DEFAULT-PROCESS=Thread-1
DEFAULT-LOCATION=org.demonstration
DEFAULT-LOGLEVEL=INFO
REPEAT=7
VERBOSE=false
Source 1 Config Source 2 Config
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Demo Output to Slack
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Realworld & Possible scaling &
deployment approaches
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Addressing Real-World Challenges
In the realworld we have more significant challenges …
• Highly distributed solutions that need to have logging and monitoring
consolidated
• Tracing for reactive and solutions – context switching rather than threads in
the execution
• Often different teams want to use different tools – security want Splunk, DBAs
want OEM, infrastructure teams want Nagios – making setup of environments
more complex than need be
• Some operational events are more critical than others – need to filter those
out
• Make legacy solutions easier to operate, isolate log events and tag them with
operational code references – so process & care embedded without impacting
the app
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
FluentD – Scaling & Aggregation
App A
(Front End)
Server
App B
Server
Server
Shared Persistence / Analytics Platform
Ops
Alerting
Service
Server
App A
(Mid Tier)
Server
App A
(Mid Tier)
Server
App C
Server
Server Server
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
FluentD – Scaling & Aggregation
Kubernetes / Container
App A
(Front End)
Pod
App B
Pod
Svc
Shared Persistence / Analytics Platform
Ops
Alerting
Service
Pod
App A
(Mid Tier)
Pod
App A
(Mid Tier)
Pod
App C
Pod
Svc
Pod
Worker Node
Worker Node
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
FluentD – Scaling & Aggregation
Kubernetes / Container
App A
(Front End)
Pod
App B
Pod
Pod
Shared Persistence / Analytics Platform
Ops
Alerting
Service
Pod
App A
(Mid Tier)
Pod
App A
(Mid Tier)
Pod
App C
Pod
Pod Pod
Worker Node
Worker Node
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
FluentD – Scaling & Aggregation
Kubernetes / Container – using Side Cars
App A
(Front End)
Pod
App B
Pod
Pod
Shared Persistence / Analytics Platform
Ops
Alerting
Service
Pod
App A
(Mid Tier)
Pod
App A
(Mid Tier)
Pod
App C
Pod
Pod Pod
Worker Node
Worker Node
Side
Car
Side
Car
Side
Car
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Prometheus Server
Retrieval TSDB
HTTP
Server
Storage Prometheu
s UI
Prometheus
Push Gateway
Grafana
API Clients
Exporters
Prometheus
Alert Mgr
Exporters
Exporter
Fluentd
Fluentd
eMail
Other
External
Process Push
Fluentd
Process
Service Discovery
Kubernetes File AD
Fluentd with Prometheus
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Real Use Case
Cloud Native
Monitoring
/ Cloud Watch
Elasticsearch
– analytics /
search
JIRA
search process
may result in
values set to
Prometheus
Analytics
Fluentd
(Aggregate & Route)
Notification
channels like
Slack
Information Source
Capture
Structure & Route Aggregate & Analyze
Visualize
Data
Notify &
Alert
Limited to subset
of SEIM events
App
(Open
Tracing
API)
Collector
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
Thankyou
Phil Wilkins
Technology Evangelist
Oracle Ace Director
uk.linkedin.com/in/philWilkins
@PhilAtCapgemini /
@MP3Monster
Oracle-integration.cloud /
APIPlatform.cloud /
Blog.mp3monster.org
Blog.mp3monster.org @mp3monster ‹#›
© 2021 Phil Wilkins. All rights reserved.
With more than 190,000 people, Capgemini is present in over 40 countries and
celebrates its 50th Anniversary year in 2018. A global leader in consulting, technology
and outsourcing services, the Group reported 2016 global revenues of EUR 12.5 billion.
Together with its clients, Capgemini creates and delivers business, technology and
digital solutions that fit their needs, enabling them to achieve innovation and
competitiveness. A deeply multicultural organization, Capgemini has developed its own
way of working, the Collaborative Business Experience™, and draws on Rightshore®, its
worldwide delivery model.
About Capgemini
Learn more about us at
www.capgemini.com
This message contains information that may be privileged or confidential and is
the property of the Capgemini Group.
Copyright © 2018 Capgemini. All rights reserved.
Rightshore® is a trademark belonging to Capgemini.
This message is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please
notify the sender immediately and delete all copies of this message.

How fluentd fits into the modern software landscape

  • 1.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Making Logs Work for you with Fluentd Phil Wilkins Technology Evangelist Oracle Ace Director uk.linkedin.com/in/philWilkins @PhilAtCapgemini / @MP3Monster Oracle-integration.cloud / APIPlatform.cloud / Blog.mp3monster.org
  • 2.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. The About Me … Me in 5: • Husband, Father, Blogger & Author • Technical Architect, Tech Evangelist • Work for Capgemini UK as part of a multi award winning team • Work with primarily open source + Oracle cloud & middleware • Know more – mp3monster.org https://www.manning.com/ books/logging-in-action
  • 3.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Capgemini is One of the World's Largest Consulting, Technology, and Outsourcing Firms & a global “full service” business transformation provider Group Workforce: 200,000+ Globally Asia Pacific Latin America Canada United States Mexico Brazil Argentina Europe Morocco Australia People’s Republic of China India Chile Guatemala Russia Singapore Hong Kong North America UK & Ireland Nordics Benelux “It is the quality of our people, and their capacity to deliver fitting solutions, with you and for you, that drive real business results.” Across 40+ countries, 100 nationalities 5Businesses Revenue 12,8 Billion EUR (2017) Central Europe Morocco Net Profit €1,18B  Targeting Value  Mitigating Risk  Optimising Capabilities  Aligning the Organisation Elements to successful collaboration Application Services Infrastructure Services Business Process Outsourcing Consulting (Capgemini Consulting) Local Professional 4
  • 4.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Putting Monitoring & Log Analytics into Perspective Host / Infrastructure Monitoring Virtualization / Container Monitoring Application Monitoring Business Application Monitoring Security / SIEM Capacity Monitoring Metrics – Typically Numerical (sample based data e.g. CPU use) Logs Textual (event based data e.g. app logging, SNMP traps) Observability Pillars / Key Traces (execution flow & timing – transaction based, sampled) Cambridge English Dictionary definition of Monitor: to look at something for a period of time, especially something that is changing or moving Observe: to watch carefully the way something happens or the way someone does something, especially in order to learn more about it The idea that there are 3 Pillars of Observability has been around for a while:
  • 5.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Application of Logs • Spotting unexpected errors • performance issues • Who did what & when • Blend for end to end picture • What is happening and how does it impact our business!!
  • 6.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Increasing Complexity of End to End Solutions Evolution Sophistication / Complexity Apache Tomcat / Servlets Async BEPL in Clustered SOA Async BEPL in Clustered SOA + JMS multi- consumer Node.js / Kafka consumer s Purist Containerized Microservices / Function as a Service OSB Sync Flows in SOA No Concurrency Concurrency through threads – 1 thread ran the transaction Asynchronous Concurrency (thread sharing / reactive models) Distributed Concurrency Modern Development Techniques SOA / Service Bus Techniques
  • 7.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Highly Pluggable Framework Input • TCP/UDP • Unix Sockets • HTTP • Many file formats • SNMP traps • OS (Linux/UNIX) • Log4J, SLF4J and other related frameworks for .Net, JavaScript Output • ALM solutions e.g. Splunk, cloud native solutions, loggly, logzio etc. • HTTP • Prometheus • Grafana • Many file formats • DB (SQL/NoSQL) • Event Streams e.g. Kafka, SS, Kenesis, MQTT • Social notifications e.g. Jabber, Slack, emai, twilio l etc • Support mgmt tools like pagerduty Buffer / Cache • Custom in memory cache • Redis Storage • S3 buckets • Db • Redis Formatter • XML • JSON • CSV/TSV etc. • Compressed formats Parser • Multline text to single event • Event info extraction e.g. date & time Filters • Value based conditions • REGEX expressions Custom components Amusing Ruby Gems it is possible to build any custom components using the framework provided
  • 8.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. • e.g. myInput • Logical name defined by source definition Tag • e.g. 1362050500.000000000 • Defined by time into Fluentd unless mapped from received event TimeStamp • e.g. {“doYou” : “believe”, “this” : “content” } • Can be received as anything but treated as a JSON object Record Log Event Make Up
  • 9.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Data to Actionable Information Information Source Capture • Infra structure such as CPU, memory use • JVM use • App Log Files • SNMP Traps Structure & Route • Get the raw data to the appropriate tooling in a format that can be processed Aggregate & Analyze •Data from multiple sources •Merge in time series Visualize Data • Search for log events • Present trends e.g. memory consumption, • Rate of storage consumption Notify & Alert •Push events into JIRA Svc Desk, Slack, etc •Rules on severity dictate behaviours Fluentd – Optimal Fluentd – Leverage Other Tools
  • 10.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. ELK / EFK Logging Stacks Log Aggregation / Unification Analytics & Search Visualization Kibana Elastic Search Logstash Beats (Lightweight variant) ELK Elastic Search Kibana Fluent Bit (Lightweight variant) Fluentd EFK
  • 11.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Central Node (Node 2) (Single Instance) Node 1 (Instance n) Multi Node Demo • Transsform (event  message) • Match + copy: • Out file • relabel labelPipeline basic-file.txt basic-file2.txt label-pipeline-file-output.* forwarder common • filter Slack Stdout / Monitoring Warboard Op Analytics filters
  • 12.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Central Node (Node 2) (Single Instance) Node 1 (Instance n) Multi Node Demo • Transsform (event  message) • Match + copy: • Out file • relabel labelPipeline basic-file.txt basic-file2.txt label-pipeline-file-output.* forwarder common • filter Slack stdout
  • 13.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Fluentd Config Example – Node 1 <system> Log_Level info </system> #### begin - tail basic file <source> @type tail path ./Chapter6/basic-file.txt read_lines_limit 5 tag basicFile pos_file ./Chapter6/basic-file-read.pos_file read_from_head true <parse> @type json </parse> @label labelPipeline </source> #### end - file 1 #### begin - tail basic-file2 <source> @type tail path ./Chapter6/basic-file2.txt read_lines_limit 5 tag basicFILE2 pos_file ./Chapter6/basic-file- read2.pos_file read_from_head true <parse> @type json </parse> @label forwarder </source> #### end - tail basic-file2 <label labelPipeline> align naming <filter *> @type record_transformer <record> message ${record["event"]} transformed yes event - </record> </filter> #### begin - file out 1 <match *> @type copy <store> @type file path ./Chapter6/label-pipeline-file-output <buffer> delayed_commit_timeout 10 flush_at_shutdown true chunk_limit_records 50 flush_interval 15 flush_mode interval </buffer> <format> @type out_file delimiter comma output_tag true </format> </store> <store> @type relabel @label forwarder </store> </match> </label> <label forwarder> <match *> @type forward buffer_type memory flush_interval 5s <server> host 127.0.0.1 port 28080 </server> </match> </label>
  • 14.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Fluentd Config Example – Node 2 <system> Log_Level info </system> <source> @type forward port 28080 bind 0.0.0.0 @label common </source> #### begin - for log events with the label common <label common> #<filter *> # @type stdout #</filter> <filter *> @type grep <regexp> key message pattern /omputer/ </regexp> </filter> <filter *> @type stdout </filter> <match *> @type slack token xoxb-xyz1234567890 username me icon_emoji :ghost: # if you don't want to use icon_url, delete this param. channel general message Node2 says - %s message_keys message title %s title_keys tag flush_interval 1s time_key time </match> </label>
  • 15.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Fluentd Config Example – Test Tool Config SOURCE=.testDatamedium-source.txt TARGETFILE=./Demo/basic-file.txt #%t (+1 or timestamp format %l = log level e. g. DEBUG %c class e.g. demo.code.com %p proc ess or thread id %m mlog message SOURCEFORMAT=%t %m TARGETFORMAT={"source":"basicFile", "event":"% m", "cycle":%i} OUTPUTTYPE=file DEFAULT-PROPCESS=Thread-1 DEFAULT-LOCATION=com.demo DEFAULT-LOGLEVEL=INFO REPEAT=5 VERBOSE=true SOURCE=.testDatasmall-fact-source.txt TARGETFILE=./Demo/basic-file2.txt #%t (+1 or timestamp format %l = log level e.g. DEBUG %c class e.g. demo.code.com %p process or thread id %m mlog message SOURCEFORMAT=%t %m TARGETFORMAT={"message":"%m", "stream":"basicFILE 2", "iter":%i} OUTPUTTYPE=file DEFAULT-PROCESS=Thread-1 DEFAULT-LOCATION=org.demonstration DEFAULT-LOGLEVEL=INFO REPEAT=7 VERBOSE=false Source 1 Config Source 2 Config
  • 16.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Demo Output to Slack
  • 17.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Realworld & Possible scaling & deployment approaches
  • 18.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Addressing Real-World Challenges In the realworld we have more significant challenges … • Highly distributed solutions that need to have logging and monitoring consolidated • Tracing for reactive and solutions – context switching rather than threads in the execution • Often different teams want to use different tools – security want Splunk, DBAs want OEM, infrastructure teams want Nagios – making setup of environments more complex than need be • Some operational events are more critical than others – need to filter those out • Make legacy solutions easier to operate, isolate log events and tag them with operational code references – so process & care embedded without impacting the app
  • 19.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. FluentD – Scaling & Aggregation App A (Front End) Server App B Server Server Shared Persistence / Analytics Platform Ops Alerting Service Server App A (Mid Tier) Server App A (Mid Tier) Server App C Server Server Server
  • 20.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. FluentD – Scaling & Aggregation Kubernetes / Container App A (Front End) Pod App B Pod Svc Shared Persistence / Analytics Platform Ops Alerting Service Pod App A (Mid Tier) Pod App A (Mid Tier) Pod App C Pod Svc Pod Worker Node Worker Node
  • 21.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. FluentD – Scaling & Aggregation Kubernetes / Container App A (Front End) Pod App B Pod Pod Shared Persistence / Analytics Platform Ops Alerting Service Pod App A (Mid Tier) Pod App A (Mid Tier) Pod App C Pod Pod Pod Worker Node Worker Node
  • 22.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. FluentD – Scaling & Aggregation Kubernetes / Container – using Side Cars App A (Front End) Pod App B Pod Pod Shared Persistence / Analytics Platform Ops Alerting Service Pod App A (Mid Tier) Pod App A (Mid Tier) Pod App C Pod Pod Pod Worker Node Worker Node Side Car Side Car Side Car
  • 23.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Prometheus Server Retrieval TSDB HTTP Server Storage Prometheu s UI Prometheus Push Gateway Grafana API Clients Exporters Prometheus Alert Mgr Exporters Exporter Fluentd Fluentd eMail Other External Process Push Fluentd Process Service Discovery Kubernetes File AD Fluentd with Prometheus
  • 24.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Real Use Case Cloud Native Monitoring / Cloud Watch Elasticsearch – analytics / search JIRA search process may result in values set to Prometheus Analytics Fluentd (Aggregate & Route) Notification channels like Slack Information Source Capture Structure & Route Aggregate & Analyze Visualize Data Notify & Alert Limited to subset of SEIM events App (Open Tracing API) Collector
  • 25.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. Thankyou Phil Wilkins Technology Evangelist Oracle Ace Director uk.linkedin.com/in/philWilkins @PhilAtCapgemini / @MP3Monster Oracle-integration.cloud / APIPlatform.cloud / Blog.mp3monster.org
  • 26.
    Blog.mp3monster.org @mp3monster ‹#› ©2021 Phil Wilkins. All rights reserved. With more than 190,000 people, Capgemini is present in over 40 countries and celebrates its 50th Anniversary year in 2018. A global leader in consulting, technology and outsourcing services, the Group reported 2016 global revenues of EUR 12.5 billion. Together with its clients, Capgemini creates and delivers business, technology and digital solutions that fit their needs, enabling them to achieve innovation and competitiveness. A deeply multicultural organization, Capgemini has developed its own way of working, the Collaborative Business Experience™, and draws on Rightshore®, its worldwide delivery model. About Capgemini Learn more about us at www.capgemini.com This message contains information that may be privileged or confidential and is the property of the Capgemini Group. Copyright © 2018 Capgemini. All rights reserved. Rightshore® is a trademark belonging to Capgemini. This message is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Editor's Notes

  • #2 Being more Fluent with your logs To understand what our solutions are doing we need to log events together from multiple sources - not necessarily easy, and then sharing the right events to the right tools, which is harder. Making log events actionable challenging. CNCF's star, Fluentd presents us with a means to simplify the monitoring landscape, address challenges of hyper-distribution occurring with microservice solutions, allowing different tools needing log data to help in their different way. In this session we’ll explore the challenges of modern log management. We’ll look at how it works and what it can bring to making both development and ops activities easier. To do this we’ll explore examples of Fluentd and how it makes life easier.
  • #6 https://threadreaderapp.com/thread/1020188389721530368.html Twitter had an observability team ten years ago https://www.oreilly.com/library/view/distributed-systems-observability/9781492033431/ Distributed Systems Observability - Cindy Sridharan Hungarian-American engineer Rudolf E. Kálmán formalized the idea of observability in a paper describing characteristics of linear dynamic systems 1961 https://en.wikipedia.org/wiki/Rudolf_E._K%C3%A1lm%C3%A1n His work was important Nasa Google’s 4 golden signals Latency Traffic Errors saturation
  • #7 Understand the cause of performance issues Insight into who / what is interacting with the system(s) Spotting when unexpected errors occur (e.g. unexpected edge case scenarios) Performance management – harvesting slow running queries, scissor lockout and deadly embraces on threads, infinite loop conditions, unresponsive threads Blend multiple logs to get end to end picture Understand potential causes of loss of data integrity
  • #9 What is Fluentd? Fluentd is an open source log collector, processor, and aggregator that was created back in 2011 by the folks at Treasure Data. Written in Ruby, Fluentd was created to act as a unified logging layer — a one-stop component that can aggregate data from multiple sources, unify the differently formatted data into JSON objects and route it to different output destinations. Design wise — performance, scalability, and reliability are some of Fluentd’s outstanding features. A vanilla Fluentd deployment will run on ~40MB of memory and is capable of processing above 10,000 events per second. Adding new inputs or outputs is relatively simple and has little effect on performance. Fluentd uses disk or memory for buffering and queuing to handle transmission failures or data overload and supports multiple configuration options to ensure a more resilient data pipeline. Fluentd has been around for some time now and has developed a rich ecosystem consisting of more than 700 different plugins that extend its functionality. Fluentd is the de-facto standard log aggregator used for logging in Kubernetes and as mentioned above, is one of the widely used Docker images. What is Fluent Bit? Fluent Bit is an open source log collector and processor also created by the folks at Treasure Data in 2015. Written in C, Fluent Bit was created with a specific use case in mind — highly distributed environments where limited capacity and reduced overhead (memory and CPU) are a huge consideration.   To serve this purpose, Fluent Bit was designed for high performance and comes with a super light footprint, running on ~450KB only. An abstracted I/O handler allows asynchronous and event-driven read/write operations. For resiliency and reliability, various configuration option are available for defining retries and the buffer limit. Fluent Bit is also extensible, but has a smaller eco-system compared to Fluentd. Inputs include syslog, tcp, systemd/journald but also CPU, memory, and disk. Outputs include Elasticsearch, InfluxDB, file and http. For Kubernetes deployments, a dedicated filter plugin will add metadata to log data, such as the pod’s name and namespace, and the containers name/ID.
  • #10 What is Fluentd? Fluentd is an open source log collector, processor, and aggregator that was created back in 2011 by the folks at Treasure Data. Written in Ruby, Fluentd was created to act as a unified logging layer — a one-stop component that can aggregate data from multiple sources, unify the differently formatted data into JSON objects and route it to different output destinations. Design wise — performance, scalability, and reliability are some of Fluentd’s outstanding features. A vanilla Fluentd deployment will run on ~40MB of memory and is capable of processing above 10,000 events per second. Adding new inputs or outputs is relatively simple and has little effect on performance. Fluentd uses disk or memory for buffering and queuing to handle transmission failures or data overload and supports multiple configuration options to ensure a more resilient data pipeline. Fluentd has been around for some time now and has developed a rich ecosystem consisting of more than 700 different plugins that extend its functionality. Fluentd is the de-facto standard log aggregator used for logging in Kubernetes and as mentioned above, is one of the widely used Docker images. What is Fluent Bit? Fluent Bit is an open source log collector and processor also created by the folks at Treasure Data in 2015. Written in C, Fluent Bit was created with a specific use case in mind — highly distributed environments where limited capacity and reduced overhead (memory and CPU) are a huge consideration.   To serve this purpose, Fluent Bit was designed for high performance and comes with a super light footprint, running on ~450KB only. An abstracted I/O handler allows asynchronous and event-driven read/write operations. For resiliency and reliability, various configuration option are available for defining retries and the buffer limit. Fluent Bit is also extensible, but has a smaller eco-system compared to Fluentd. Inputs include syslog, tcp, systemd/journald but also CPU, memory, and disk. Outputs include Elasticsearch, InfluxDB, file and http. For Kubernetes deployments, a dedicated filter plugin will add metadata to log data, such as the pod’s name and namespace, and the containers name/ID.
  • #12 Any distributed monitoring and log management solution typically follows the following sequence of events. Depending on the toolset and goal of the monitoring, it may result in one or more steps may be fulfilled by a single tool. For example the combination of Splunk agents, Splunk engine & dashboard all of these stages are covered within a single tool. Note FluentD does NOT provide deep data analyse capabilities – for this we leaverage tools
  • #13 Plugins: ~500 Fluentd vs 200 Logstash Style: declarative – fluentd; programmatic Logstash Performance: Fluentd more compact with smaller memory footprint Caching: flexible Fluentd. Logstash – restrictive – memory size based Implementation: Fluentd CRuby. Logstash Jruby
  • #15 Walk through the demo resources fluentd -c Demo/Fluentd/node2-file-source-multi-out-label-pipelines.conf fluentd -c Demo/Fluentd/node1-file-source-multi-out-label-pipelines.conf run-log-simulator.bat Demo/SimulatorConfig/basic-log-file.properties run-log-simulator.bat Demo/SimulatorConfig/basic-log-file2.properties
  • #17 Node 1
  • #18 Node 2
  • #19 Node 2
  • #24 Switch to the simpler FluentBit – to reduce pod size Explain fluentbit – but examine differences – limits on interchangability
  • #25 - Switch to the simpler FluentBit – to reduce pod size