SlideShare a Scribd company logo
1 of 55
Download to read offline
P Y C O N T W - 2 0 1 7
P Y C O N TA I WA N - 2 0 1 7
E R I C ( B Y U N G W O O K ) A H N
Te n s o r f l o w & P y t h o n :
F a u l t D e t e c t i o n S y s t e m
Who am I
Experienced
CDN
Media streaming
Device driver(windows, linux)
2015 PyCon KR
2015 PyCon HK
2016 Swift KR
2016 Tensorflow KR
2017 PyCon Taiwan
?
FA U LT D E T E C T I O N
L O G L O G L O G
L O G 2 M L
T O D A Y …
3 P Y C O N T W - 2 0 1 7
P Y C O N T W - 2 0 1 7
Currently, My company has over
200 services.
They’re using different systems,
located at different IDC.
P Y C O N T W - 2 0 1 7
What is a Fault Detection?
5
P Y C O N T W - 2 0 1 7
Before knowing Fault Detection!
We need to know what a Fault is.
6
P Y C O N T W - 2 0 1 7
Fault
Wikipedia : A fault is defined as an abnormal
condition or defect at the component, equipment,
or sub-system level which may lead to a failure.
7
P Y C O N T W - 2 0 1 7
There are many Fault
Detection System.
8
P Y C O N T W - 2 0 1 7
In Generally,
Usage of CPU, Memory, Disk I/O
Network bandwidth
System Log, Application Log
JVM monitoring
URI check
…
9
P Y C O N T W - 2 0 1 7
PRTG
Cacti
zabbix
L4/L7(Commercial Product)
Log and Process monitoring ( Commercial Product)
DB Monitoring ( Open source, Commercial Product)
Application Performance Monitoring ( APM ) for JVM
ElasticSearch
Hadoop
grafana
kibana
…
10
P Y C O N T W - 2 0 1 7
Many views, Charts, and Alarm system in a IDC Center
11
P Y C O N T W - 2 0 1 7
I would like to detect a Fault
with ML.
12
P Y C O N T W - 2 0 1 7
LOG LOG LOG
13
P Y C O N T W - 2 0 1 7
Log format
apache
squid
custom log format
..
14
P Y C O N T W - 2 0 1 7
Type of log log filename daemon description
kernel log /dev/console kernel Console log
system log /var/log/messages syslogd
security log /var/log/secure xinetd
mail log /var/log/maillog sendmail Sendmail
cron log /var/log/cron crowd
booting log /var/log/boot.log kernel
kernel boot log /var/dmesg kernel
kernel log /var/log/wtmp kernel Record a system login totally
kernel log /var/log/utmp kernel Record current login, ip ..
ftp log /var/log/xferlog ftpd
http log /var/log/httpd/access.log httpd
http error log /var/log/httpd/error.log httpd
named log /var/log/named.log named
Application log depends on application app daemon
15
P Y C O N T W - 2 0 1 7
Example :
system log
( /var/log/messages )
16
P Y C O N T W - 2 0 1 7
May 14 03:43:01 web01 rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1673" x-info="http://www.rsyslog.com"] rsyslogd was
HUPed
May 14 04:40:01 web01 ntpdate[6617]: the NTP socket is in use, exiting
May 14 05:40:01 web01 ntpdate[8437]: the NTP socket is in use, exiting
May 14 06:40:01 web01 ntpdate[10212]: the NTP socket is in use, exiting
May 14 07:40:01 web01 ntpdate[12315]: the NTP socket is in use, exiting
May 14 08:40:01 web01 ntpdate[14090]: the NTP socket is in use, exiting
May 14 15:40:01 web01 ntpdate[27169]: the NTP socket is in use, exiting
May 14 16:40:01 web01 ntpdate[28940]: the NTP socket is in use, exiting
May 14 17:40:01 web01 ntpdate[30706]: the NTP socket is in use, exiting
May 14 18:40:01 web01 ntpdate[32818]: the NTP socket is in use, exiting
May 14 19:40:01 web01 ntpdate[34583]: the NTP socket is in use, exiting
Mar 15 10:45:58 web01 oddjobd: oddjobd shutdown succeeded
Mar 15 10:45:59 web01 sshd[1153]: Received signal 15; terminating.
Mar 15 10:45:59 web01 snmpd[1139]: Received TERM or STOP signal... shutting down...
Mar 15 10:45:59 web01 snmpd[1139]: snmpd: send_trap: Failure in sendto (Network is unreachable)
Mar 15 10:45:59 web01 xinetd[1164]: Exiting...
Mar 15 10:45:59 web01 ntpd[1175]: ntpd exiting on signal 15
Mar 15 10:45:59 web01 init: Disconnected from system bus
Mar 15 10:45:59 web01 console-kit-daemon[37526]: WARNING: no sender#012
Mar 15 10:45:59 web01 nslcd[1073]: caught signal SIGTERM (15), shutting down
Mar 15 10:45:59 web01 nslcd[1073]: version 0.7.5 bailing out
Mar 15 10:45:59 web01 kernel: Kernel logging (proc) stopped.
May 16 03:40:01 web01 ntpdate[49591]: the NTP socket is in use, exiting
May 16 04:40:01 web01 ntpdate[51553]: the NTP socket is in use, exiting
May 16 05:40:01 web01 ntpdate[53365]: the NTP socket is in use, exiting
May 16 11:40:01 web01 ntpdate[64664]: the NTP socket is in use, exiting
May 16 12:40:01 web01 ntpdate[1211]: the NTP socket is in use, exiting
May 16 13:29:40 web01 sshd[2748]: Did not receive identification string from 10.40.133.188
May 16 13:29:45 web01 sshd[2749]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.40.133.188
user=pycon
May 16 13:29:45 web01 sshd[2749]: Accepted password for pycon from 10.40.133.188 port 57463 ssh2
May 16 13:29:45 web01 sshd[2749]: pam_unix(sshd:session): session opened for user pycon by (uid=0)
May 16 13:29:49 web01 su: pam_unix(su-l:session): session opened for user root by pycon(uid=9000709)
May 16 13:31:24 web01 sshd[2749]: pam_unix(sshd:session): session closed for user pycon
17
P Y C O N T W - 2 0 1 7
LOG2ML
18
P Y C O N T W - 2 0 1 7
Log data is also natural language.
The sequence of words and
expressions is important
sequential data.
19
P Y C O N T W - 2 0 1 7
Machine Learning
Supervided learing
vs
unsupervised learning
Binary classification
vs
Multi-label classification
Sentences Clustering
Topic modeling
word2vec, doc2vec,
paragraph2vec
Sentiment Analysis
CNN
RNN
20
P Y C O N T W - 2 0 1 7
As you know, CNN is an
architecture to process
for image classification.
21
P Y C O N T W - 2 0 1 7
ref(2) : “cs231n : Covolutional Neural Networks for Visual Recognition”, Stanford
A regular 3-layer Neural Network.
ConvNet Architecture
22
P Y C O N T W - 2 0 1 7
What is a Conv layer
compute the output of neurons that are connected to local
regions in the input, each computing a dot product between
their weights and a small region they are connected to in the
input volume.
23
P Y C O N T W - 2 0 1 7
0 0 1 1 0
0 1 1 1 0
0 0 1 1 0
0 0 1 1 0
0 1 1 1 1
3 3 3
2 4 3
2 4 4
Original Image
Convolved Feature
3x3 filter
x1 x0 x1
x0 x1 x0
x1 x0 x1
24
P Y C O N T W - 2 0 1 7
3
3x3 filter
x1 x0 x1
x0 x1 x0
x1 x0 x1
0x1 0x0 1x1 1 0
0x0 1x1 1x0 1 0
0x1 0x0 1x1 1 0
0 0 1 1 0
0 1 1 1 1
25
P Y C O N T W - 2 0 1 7
3 3
3x3 filter
x1 x0 x1
x0 x1 x0
x1 x0 x1
0 0x1 1x0 1x1 0
0 1x0 1x1 1x0 0
0 0x1 1x0 1x1 0
0 0 1 1 0
0 1 1 1 1
26
P Y C O N T W - 2 0 1 7
3 3 3
3x3 filter
x1 x0 x1
x0 x1 x0
x1 x0 x1
0 0 1x1 1x0 0x1
0 1 1x0 1x1 0x0
0 0 1x1 1x0 0x1
0 0 1 1 0
0 1 1 1 1
27
P Y C O N T W - 2 0 1 7
3 3 3
2
3x3 filter
x1 x0 x1
x0 x1 x0
x1 x0 x1
0 0 1 1 0
0x1 1x0 1x1 1 0
0x0 0x1 1x0 1 0
0x1 0x0 1x1 1 0
0 1 1 1 1
28
P Y C O N T W - 2 0 1 7
3 3 3
2 4
3x3 filter
x1 x0 x1
x0 x1 x0
x1 x0 x1
0 0 1 1 0
0 1x1 1x0 1x1 0
0 0x0 1x1 1x0 0
0 0x1 1x0 1x1 0
0 1 1 1 1
29
P Y C O N T W - 2 0 1 7
3 3 3
2 4 3
3x3 filter
x1 x0 x1
x0 x1 x0
x1 x0 x1
0 0 1 1 0
0 1 1x1 1x0 0x1
0 0 1x0 1x1 0x0
0 0 1x1 1x0 0x1
0 1 1 1 1
30
P Y C O N T W - 2 0 1 7
3 3 3
2 4 3
2
3x3 filter
x1 x0 x1
x0 x1 x0
x1 x0 x1
0 0 1 1 0
0 1 1 1 0
0x1 0x0 1x1 1 0
0x0 0x1 1x0 1 0
0x1 1x0 1x1 1 1
31
P Y C O N T W - 2 0 1 7
3 3 3
2 4 3
2 4
3x3 filter
x1 x0 x1
x0 x1 x0
x1 x0 x1
0 0 1 1 0
0 1 1 1 0
0 0x1 1x0 1x1 0
0 0x0 1x1 1x0 0
0 1x1 1x0 1x1 1
32
P Y C O N T W - 2 0 1 7
3 3 3
2 4 3
2 4 4
3x3 filter
x1 x0 x1
x0 x1 x0
x1 x0 x1
0 0 1 1 0
0 1 1 1 0
0 0 1x1 1x0 0x1
0 0 1x0 1x1 0x0
0 1 1x1 1x0 1x1
33
Convolved Feature
P Y C O N T W - 2 0 1 7
ref(2) : “cs231n : Covolutional Neural Networks for Visual Recognition”, Stanford
A regular 3-layer Neural Network.
ConvNet Architecture
34
P Y C O N T W - 2 0 1 7
Sentence, Paragraph,
Document?
35
P Y C O N T W - 2 0 1 7
Convolutional Neural Networks for Sentence Classification
ref(1) : “Convolutional Neural Networks for Sentence Classification”, 2014y
36
Using Text CNN filter
- Save a locally information of text, sequential data, and
context information
P Y C O N T W - 2 0 1 7
Log2ML ( CNN )
37
P Y C O N T W - 2 0 1 7
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
snmpd[1139]: Received TERM or STOP signal shutting down, fault
caught SIGTERM shutting down, fault
SIGHUP received Attempting to restart, fault
sshd[2749]: Accepted password for pycon from 10.40.133.188 port 57463 ssh2, normal
ntpdate[27169]: the NTP socket is in use exiting, normal
Messages log :
38
fault
normal
category
P Y C O N T W - 2 0 1 7
# To make an index for words use VocabularyProcess() function of Tensorflow
vocab_processor = tf.contrib.learn.preprocessing.VocabularyProcessor(max_document_length)
x_train = np.array(list(self.vocab_processor.fit_transform(x_train)))
log example
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
39
P Y C O N T W - 2 0 1 7
embedding size
vocab size :
number of
words
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
W = tf.Variable(tf.random_uniform([vocab_size, embedding_size], -1.0, 1.0), name=“W")
embedded_chars = tf.nn.embedding_lookup(W, input_x)
40
P Y C O N T W - 2 0 1 7
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
filter_shape = [filter_size, embedding_size, 1, num_filters]
W = tf.Variable(tf.truncated_normal(filter_shape, stddev=0.1), name="W")
b = tf.Variable(tf.constant(0.1, shape=[num_filters]), name="b")
conv = tf.nn.conv2d(
self.embedded_chars_expanded,
W,
strides=[1, 1, 1, 1],
padding="VALID",
name=“conv")
h = tf.nn.relu(tf.nn.bias_add(conv, b), name="relu")
41
P Y C O N T W - 2 0 1 7
word V1 V2 V3 … Vp-2 Vp-1 Vp
snmpd[1139]:
Received
TERM
or
…
…
signal
shutting
down
filter
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
42
P Y C O N T W - 2 0 1 7
sliding
word V1 V2 V3 … Vp-2 Vp-1 Vp
snmpd[1139]:
Received
TERM
or
…
…
signal
shutting
down
filter
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
43
P Y C O N T W - 2 0 1 7
word V1 V2 V3 … Vp-2 Vp-1 Vp
snmpd[1139]:
Received
TERM
or
…
…
signal
shutting
down
filter
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
44
P Y C O N T W - 2 0 1 7
word V1 V2 V3 … Vp-2 Vp-1 Vp
snmpd[1139]:
Received
TERM
or
…
…
signal
shutting
down
filter
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
45
P Y C O N T W - 2 0 1 7
word V1 V2 V3 … Vp-2 Vp-1 Vp
snmpd[1139]:
Received
TERM
or
…
…
signal
shutting
down
filter
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
46
P Y C O N T W - 2 0 1 7
word V1 V2 V3 … Vp-2 Vp-1 Vp
snmpd[1139]:
Received
TERM
or
…
…
signal
shutting
down
filter
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
47
P Y C O N T W - 2 0 1 7
word V1 V2 V3 … Vp-2 Vp-1 Vp
snmpd[1139]:
Received
TERM
or
…
…
signal
shutting
down
filter
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
48
Finally, we get convolved feature
P Y C O N T W - 2 0 1 7
word V1 V2 V3 … Vp-2 Vp-1 Vp
snmpd[1139]:
Received
TERM
or
…
…
signal
shutting
down
filter
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
49
filter size : 4
P Y C O N T W - 2 0 1 7
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
pooled = tf.nn.max_pool(
h,
ksize=[1, sequence_length - filter_size + 1, 1, 1],
strides=[1, 1, 1, 1],
padding='VALID',
name=“pool")
# Combine all the pooled features
num_filters_total = num_filters * len(filter_sizes)
self.h_pool = tf.concat(3, pooled_outputs)
self.h_pool_flat = tf.reshape(self.h_pool, [-1, num_filters_total])
50
P Y C O N T W - 2 0 1 7
Input Layer
Conv. Layer
Pooling Layer
Fully-
Connected
Layer
with tf.name_scope("output"):
W = tf.get_variable(
"W",
shape=[num_filters_total, num_classes],
initializer=tf.contrib.layers.xavier_initializer())
b = tf.Variable(tf.constant(0.1, shape=[num_classes]), name="b")
l2_loss += tf.nn.l2_loss(W)
l2_loss += tf.nn.l2_loss(b)
self.scores = tf.nn.xw_plus_b(self.h_drop, W, b, name="scores")
self.predictions = tf.argmax(self.scores, 1, name="predictions")
51
P Y C O N T W - 2 0 1 7
Convolutional Neural Networks for Sentence Classification
52
P Y C O N T W - 2 0 1 7
$ tensorboard --logdir ./runs/1496236844/summaries
53
P Y C O N T W - 2 0 1 754
P Y C O N T W - 2 0 1 7
End
Reference
(1) “Convolutional Neural Networks for Sentence Classification”, Yoon Kim, 2014y
(2) “cs231n : Covolutional Neural Networks for Visual Recognition”, Stanford
55

More Related Content

What's hot

pstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databasepstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databaseRiyaj Shamsudeen
 
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...Codemotion
 
[4] 아두이노와 인터넷
[4] 아두이노와 인터넷[4] 아두이노와 인터넷
[4] 아두이노와 인터넷Chiwon Song
 
1 million serial numbers of different softwares
1 million serial numbers of different softwares1 million serial numbers of different softwares
1 million serial numbers of different softwaresmifdov
 
Watching And Manipulating Your Network Traffic
Watching And Manipulating Your Network TrafficWatching And Manipulating Your Network Traffic
Watching And Manipulating Your Network TrafficJosiah Ritchie
 
Cassandra Community Webinar | Introduction to Apache Cassandra 1.2
Cassandra Community Webinar | Introduction to Apache Cassandra 1.2Cassandra Community Webinar | Introduction to Apache Cassandra 1.2
Cassandra Community Webinar | Introduction to Apache Cassandra 1.2DataStax
 
Serial number soft
Serial number softSerial number soft
Serial number softsandi271979
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging RubyAman Gupta
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby SystemsEngine Yard
 
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance FuckupsNETFest
 
Computer Forensics Report - FRS301 - FPT University
Computer Forensics Report - FRS301 - FPT UniversityComputer Forensics Report - FRS301 - FPT University
Computer Forensics Report - FRS301 - FPT UniversityDuc Lai Trung Minh
 
Algosec how to avoid business outages from misconfigured devices final
Algosec how to avoid business outages from misconfigured devices finalAlgosec how to avoid business outages from misconfigured devices final
Algosec how to avoid business outages from misconfigured devices finalMaytal Levi
 
6. processes and threads
6. processes and threads6. processes and threads
6. processes and threadsMarian Marinov
 
Loopback.vhd
Loopback.vhdLoopback.vhd
Loopback.vhdsachindb9
 
Dbms plan - A swiss army knife for performance engineers
Dbms plan - A swiss army knife for performance engineersDbms plan - A swiss army knife for performance engineers
Dbms plan - A swiss army knife for performance engineersRiyaj Shamsudeen
 
Cassandra London - C* Spark Connector
Cassandra London - C* Spark ConnectorCassandra London - C* Spark Connector
Cassandra London - C* Spark ConnectorChristopher Batey
 
Creating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server HardeningCreating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server Hardeningarchwisp
 
Vhdl practical exam guide
Vhdl practical exam guideVhdl practical exam guide
Vhdl practical exam guideEslam Mohammed
 

What's hot (20)

pstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databasepstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle database
 
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
 
[4] 아두이노와 인터넷
[4] 아두이노와 인터넷[4] 아두이노와 인터넷
[4] 아두이노와 인터넷
 
1 million serial numbers of different softwares
1 million serial numbers of different softwares1 million serial numbers of different softwares
1 million serial numbers of different softwares
 
Watching And Manipulating Your Network Traffic
Watching And Manipulating Your Network TrafficWatching And Manipulating Your Network Traffic
Watching And Manipulating Your Network Traffic
 
Cassandra Community Webinar | Introduction to Apache Cassandra 1.2
Cassandra Community Webinar | Introduction to Apache Cassandra 1.2Cassandra Community Webinar | Introduction to Apache Cassandra 1.2
Cassandra Community Webinar | Introduction to Apache Cassandra 1.2
 
Serial number soft
Serial number softSerial number soft
Serial number soft
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
 
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups
.NET Fest 2019. Łukasz Pyrzyk. Daily Performance Fuckups
 
Computer Forensics Report - FRS301 - FPT University
Computer Forensics Report - FRS301 - FPT UniversityComputer Forensics Report - FRS301 - FPT University
Computer Forensics Report - FRS301 - FPT University
 
Networking
NetworkingNetworking
Networking
 
Algosec how to avoid business outages from misconfigured devices final
Algosec how to avoid business outages from misconfigured devices finalAlgosec how to avoid business outages from misconfigured devices final
Algosec how to avoid business outages from misconfigured devices final
 
6. processes and threads
6. processes and threads6. processes and threads
6. processes and threads
 
Loopback.vhd
Loopback.vhdLoopback.vhd
Loopback.vhd
 
Dbms plan - A swiss army knife for performance engineers
Dbms plan - A swiss army knife for performance engineersDbms plan - A swiss army knife for performance engineers
Dbms plan - A swiss army knife for performance engineers
 
Cassandra London - C* Spark Connector
Cassandra London - C* Spark ConnectorCassandra London - C* Spark Connector
Cassandra London - C* Spark Connector
 
Network commands
Network commandsNetwork commands
Network commands
 
Creating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server HardeningCreating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server Hardening
 
Vhdl practical exam guide
Vhdl practical exam guideVhdl practical exam guide
Vhdl practical exam guide
 

Similar to Tensorflow and python : fault detection system - PyCon Taiwan 2017

Vista 1600 c epon olt quick start manual(r1.2)
Vista 1600 c epon olt quick start manual(r1.2)Vista 1600 c epon olt quick start manual(r1.2)
Vista 1600 c epon olt quick start manual(r1.2)Shanxi Cai
 
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Anne Nicolas
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFBrendan Gregg
 
Monitoring Containers with Weave Scope
Monitoring Containers with Weave ScopeMonitoring Containers with Weave Scope
Monitoring Containers with Weave ScopeWeaveworks
 
introduction to s7 1400 plc scada system using hmi
introduction to s7 1400 plc scada system using hmiintroduction to s7 1400 plc scada system using hmi
introduction to s7 1400 plc scada system using hmihaideralrudainy2
 
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPFOSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPFBrendan Gregg
 
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docxmetadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docxARIV4
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFBrendan Gregg
 
Honeypots - Tracking the Blackhat Community
Honeypots - Tracking the Blackhat CommunityHoneypots - Tracking the Blackhat Community
Honeypots - Tracking the Blackhat Communityamiable_indian
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPFIvan Babrou
 
MaskedVByte: SIMD-accelerated VByte
MaskedVByte: SIMD-accelerated VByteMaskedVByte: SIMD-accelerated VByte
MaskedVByte: SIMD-accelerated VByteDaniel Lemire
 
Fine grained monitoring
Fine grained monitoringFine grained monitoring
Fine grained monitoringIben Rodriguez
 
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringOSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringNETWAYS
 

Similar to Tensorflow and python : fault detection system - PyCon Taiwan 2017 (20)

Unix Monitoring Tools
Unix Monitoring ToolsUnix Monitoring Tools
Unix Monitoring Tools
 
Network design
Network designNetwork design
Network design
 
Inside Winnyp
Inside WinnypInside Winnyp
Inside Winnyp
 
Vista 1600 c epon olt quick start manual(r1.2)
Vista 1600 c epon olt quick start manual(r1.2)Vista 1600 c epon olt quick start manual(r1.2)
Vista 1600 c epon olt quick start manual(r1.2)
 
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
Kernel Recipes 2017 - Performance analysis Superpowers with Linux BPF - Brend...
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPF
 
Monitoring Containers with Weave Scope
Monitoring Containers with Weave ScopeMonitoring Containers with Weave Scope
Monitoring Containers with Weave Scope
 
introduction to s7 1400 plc scada system using hmi
introduction to s7 1400 plc scada system using hmiintroduction to s7 1400 plc scada system using hmi
introduction to s7 1400 plc scada system using hmi
 
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPFOSSNA 2017 Performance Analysis Superpowers with Linux BPF
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
 
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docxmetadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
metadatacoreProperties.xmlModel2015-07-13T030104Zthua3267th.docx
 
C&C Botnet Factory
C&C Botnet FactoryC&C Botnet Factory
C&C Botnet Factory
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
 
Honeypots - Tracking the Blackhat Community
Honeypots - Tracking the Blackhat CommunityHoneypots - Tracking the Blackhat Community
Honeypots - Tracking the Blackhat Community
 
crack satellite
crack satellite crack satellite
crack satellite
 
PROYECTO VLANS
PROYECTO VLANSPROYECTO VLANS
PROYECTO VLANS
 
Debugging linux issues with eBPF
Debugging linux issues with eBPFDebugging linux issues with eBPF
Debugging linux issues with eBPF
 
MaskedVByte: SIMD-accelerated VByte
MaskedVByte: SIMD-accelerated VByteMaskedVByte: SIMD-accelerated VByte
MaskedVByte: SIMD-accelerated VByte
 
No more dumb hex!
No more dumb hex!No more dumb hex!
No more dumb hex!
 
Fine grained monitoring
Fine grained monitoringFine grained monitoring
Fine grained monitoring
 
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoringOSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
 

More from Eric Ahn

Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-apiEric Ahn
 
Swift server-side-let swift2016
Swift server-side-let swift2016Swift server-side-let swift2016
Swift server-side-let swift2016Eric Ahn
 
Docker deploy
Docker deployDocker deploy
Docker deployEric Ahn
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in DockerEric Ahn
 
Docker command
Docker commandDocker command
Docker commandEric Ahn
 
High perforance-browse-networking-2015-bwahn
High perforance-browse-networking-2015-bwahnHigh perforance-browse-networking-2015-bwahn
High perforance-browse-networking-2015-bwahnEric Ahn
 
Cdn gslb-20151209
Cdn gslb-20151209Cdn gslb-20151209
Cdn gslb-20151209Eric Ahn
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stackEric Ahn
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-pythonEric Ahn
 
Http capturing
Http capturingHttp capturing
Http capturingEric Ahn
 
Apache module-201511
Apache module-201511Apache module-201511
Apache module-201511Eric Ahn
 
Spring rest-doc-2015-11
Spring rest-doc-2015-11Spring rest-doc-2015-11
Spring rest-doc-2015-11Eric Ahn
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-pythonEric Ahn
 
CORS review
CORS reviewCORS review
CORS reviewEric Ahn
 
Docker build #1
Docker build #1Docker build #1
Docker build #1Eric Ahn
 

More from Eric Ahn (15)

Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
 
Swift server-side-let swift2016
Swift server-side-let swift2016Swift server-side-let swift2016
Swift server-side-let swift2016
 
Docker deploy
Docker deployDocker deploy
Docker deploy
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in Docker
 
Docker command
Docker commandDocker command
Docker command
 
High perforance-browse-networking-2015-bwahn
High perforance-browse-networking-2015-bwahnHigh perforance-browse-networking-2015-bwahn
High perforance-browse-networking-2015-bwahn
 
Cdn gslb-20151209
Cdn gslb-20151209Cdn gslb-20151209
Cdn gslb-20151209
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
 
Http capturing
Http capturingHttp capturing
Http capturing
 
Apache module-201511
Apache module-201511Apache module-201511
Apache module-201511
 
Spring rest-doc-2015-11
Spring rest-doc-2015-11Spring rest-doc-2015-11
Spring rest-doc-2015-11
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
 
CORS review
CORS reviewCORS review
CORS review
 
Docker build #1
Docker build #1Docker build #1
Docker build #1
 

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Tensorflow and python : fault detection system - PyCon Taiwan 2017

  • 1. P Y C O N T W - 2 0 1 7 P Y C O N TA I WA N - 2 0 1 7 E R I C ( B Y U N G W O O K ) A H N Te n s o r f l o w & P y t h o n : F a u l t D e t e c t i o n S y s t e m
  • 2. Who am I Experienced CDN Media streaming Device driver(windows, linux) 2015 PyCon KR 2015 PyCon HK 2016 Swift KR 2016 Tensorflow KR 2017 PyCon Taiwan ?
  • 3. FA U LT D E T E C T I O N L O G L O G L O G L O G 2 M L T O D A Y … 3 P Y C O N T W - 2 0 1 7
  • 4. P Y C O N T W - 2 0 1 7 Currently, My company has over 200 services. They’re using different systems, located at different IDC.
  • 5. P Y C O N T W - 2 0 1 7 What is a Fault Detection? 5
  • 6. P Y C O N T W - 2 0 1 7 Before knowing Fault Detection! We need to know what a Fault is. 6
  • 7. P Y C O N T W - 2 0 1 7 Fault Wikipedia : A fault is defined as an abnormal condition or defect at the component, equipment, or sub-system level which may lead to a failure. 7
  • 8. P Y C O N T W - 2 0 1 7 There are many Fault Detection System. 8
  • 9. P Y C O N T W - 2 0 1 7 In Generally, Usage of CPU, Memory, Disk I/O Network bandwidth System Log, Application Log JVM monitoring URI check … 9
  • 10. P Y C O N T W - 2 0 1 7 PRTG Cacti zabbix L4/L7(Commercial Product) Log and Process monitoring ( Commercial Product) DB Monitoring ( Open source, Commercial Product) Application Performance Monitoring ( APM ) for JVM ElasticSearch Hadoop grafana kibana … 10
  • 11. P Y C O N T W - 2 0 1 7 Many views, Charts, and Alarm system in a IDC Center 11
  • 12. P Y C O N T W - 2 0 1 7 I would like to detect a Fault with ML. 12
  • 13. P Y C O N T W - 2 0 1 7 LOG LOG LOG 13
  • 14. P Y C O N T W - 2 0 1 7 Log format apache squid custom log format .. 14
  • 15. P Y C O N T W - 2 0 1 7 Type of log log filename daemon description kernel log /dev/console kernel Console log system log /var/log/messages syslogd security log /var/log/secure xinetd mail log /var/log/maillog sendmail Sendmail cron log /var/log/cron crowd booting log /var/log/boot.log kernel kernel boot log /var/dmesg kernel kernel log /var/log/wtmp kernel Record a system login totally kernel log /var/log/utmp kernel Record current login, ip .. ftp log /var/log/xferlog ftpd http log /var/log/httpd/access.log httpd http error log /var/log/httpd/error.log httpd named log /var/log/named.log named Application log depends on application app daemon 15
  • 16. P Y C O N T W - 2 0 1 7 Example : system log ( /var/log/messages ) 16
  • 17. P Y C O N T W - 2 0 1 7 May 14 03:43:01 web01 rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1673" x-info="http://www.rsyslog.com"] rsyslogd was HUPed May 14 04:40:01 web01 ntpdate[6617]: the NTP socket is in use, exiting May 14 05:40:01 web01 ntpdate[8437]: the NTP socket is in use, exiting May 14 06:40:01 web01 ntpdate[10212]: the NTP socket is in use, exiting May 14 07:40:01 web01 ntpdate[12315]: the NTP socket is in use, exiting May 14 08:40:01 web01 ntpdate[14090]: the NTP socket is in use, exiting May 14 15:40:01 web01 ntpdate[27169]: the NTP socket is in use, exiting May 14 16:40:01 web01 ntpdate[28940]: the NTP socket is in use, exiting May 14 17:40:01 web01 ntpdate[30706]: the NTP socket is in use, exiting May 14 18:40:01 web01 ntpdate[32818]: the NTP socket is in use, exiting May 14 19:40:01 web01 ntpdate[34583]: the NTP socket is in use, exiting Mar 15 10:45:58 web01 oddjobd: oddjobd shutdown succeeded Mar 15 10:45:59 web01 sshd[1153]: Received signal 15; terminating. Mar 15 10:45:59 web01 snmpd[1139]: Received TERM or STOP signal... shutting down... Mar 15 10:45:59 web01 snmpd[1139]: snmpd: send_trap: Failure in sendto (Network is unreachable) Mar 15 10:45:59 web01 xinetd[1164]: Exiting... Mar 15 10:45:59 web01 ntpd[1175]: ntpd exiting on signal 15 Mar 15 10:45:59 web01 init: Disconnected from system bus Mar 15 10:45:59 web01 console-kit-daemon[37526]: WARNING: no sender#012 Mar 15 10:45:59 web01 nslcd[1073]: caught signal SIGTERM (15), shutting down Mar 15 10:45:59 web01 nslcd[1073]: version 0.7.5 bailing out Mar 15 10:45:59 web01 kernel: Kernel logging (proc) stopped. May 16 03:40:01 web01 ntpdate[49591]: the NTP socket is in use, exiting May 16 04:40:01 web01 ntpdate[51553]: the NTP socket is in use, exiting May 16 05:40:01 web01 ntpdate[53365]: the NTP socket is in use, exiting May 16 11:40:01 web01 ntpdate[64664]: the NTP socket is in use, exiting May 16 12:40:01 web01 ntpdate[1211]: the NTP socket is in use, exiting May 16 13:29:40 web01 sshd[2748]: Did not receive identification string from 10.40.133.188 May 16 13:29:45 web01 sshd[2749]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.40.133.188 user=pycon May 16 13:29:45 web01 sshd[2749]: Accepted password for pycon from 10.40.133.188 port 57463 ssh2 May 16 13:29:45 web01 sshd[2749]: pam_unix(sshd:session): session opened for user pycon by (uid=0) May 16 13:29:49 web01 su: pam_unix(su-l:session): session opened for user root by pycon(uid=9000709) May 16 13:31:24 web01 sshd[2749]: pam_unix(sshd:session): session closed for user pycon 17
  • 18. P Y C O N T W - 2 0 1 7 LOG2ML 18
  • 19. P Y C O N T W - 2 0 1 7 Log data is also natural language. The sequence of words and expressions is important sequential data. 19
  • 20. P Y C O N T W - 2 0 1 7 Machine Learning Supervided learing vs unsupervised learning Binary classification vs Multi-label classification Sentences Clustering Topic modeling word2vec, doc2vec, paragraph2vec Sentiment Analysis CNN RNN 20
  • 21. P Y C O N T W - 2 0 1 7 As you know, CNN is an architecture to process for image classification. 21
  • 22. P Y C O N T W - 2 0 1 7 ref(2) : “cs231n : Covolutional Neural Networks for Visual Recognition”, Stanford A regular 3-layer Neural Network. ConvNet Architecture 22
  • 23. P Y C O N T W - 2 0 1 7 What is a Conv layer compute the output of neurons that are connected to local regions in the input, each computing a dot product between their weights and a small region they are connected to in the input volume. 23
  • 24. P Y C O N T W - 2 0 1 7 0 0 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 0 0 1 1 1 1 3 3 3 2 4 3 2 4 4 Original Image Convolved Feature 3x3 filter x1 x0 x1 x0 x1 x0 x1 x0 x1 24
  • 25. P Y C O N T W - 2 0 1 7 3 3x3 filter x1 x0 x1 x0 x1 x0 x1 x0 x1 0x1 0x0 1x1 1 0 0x0 1x1 1x0 1 0 0x1 0x0 1x1 1 0 0 0 1 1 0 0 1 1 1 1 25
  • 26. P Y C O N T W - 2 0 1 7 3 3 3x3 filter x1 x0 x1 x0 x1 x0 x1 x0 x1 0 0x1 1x0 1x1 0 0 1x0 1x1 1x0 0 0 0x1 1x0 1x1 0 0 0 1 1 0 0 1 1 1 1 26
  • 27. P Y C O N T W - 2 0 1 7 3 3 3 3x3 filter x1 x0 x1 x0 x1 x0 x1 x0 x1 0 0 1x1 1x0 0x1 0 1 1x0 1x1 0x0 0 0 1x1 1x0 0x1 0 0 1 1 0 0 1 1 1 1 27
  • 28. P Y C O N T W - 2 0 1 7 3 3 3 2 3x3 filter x1 x0 x1 x0 x1 x0 x1 x0 x1 0 0 1 1 0 0x1 1x0 1x1 1 0 0x0 0x1 1x0 1 0 0x1 0x0 1x1 1 0 0 1 1 1 1 28
  • 29. P Y C O N T W - 2 0 1 7 3 3 3 2 4 3x3 filter x1 x0 x1 x0 x1 x0 x1 x0 x1 0 0 1 1 0 0 1x1 1x0 1x1 0 0 0x0 1x1 1x0 0 0 0x1 1x0 1x1 0 0 1 1 1 1 29
  • 30. P Y C O N T W - 2 0 1 7 3 3 3 2 4 3 3x3 filter x1 x0 x1 x0 x1 x0 x1 x0 x1 0 0 1 1 0 0 1 1x1 1x0 0x1 0 0 1x0 1x1 0x0 0 0 1x1 1x0 0x1 0 1 1 1 1 30
  • 31. P Y C O N T W - 2 0 1 7 3 3 3 2 4 3 2 3x3 filter x1 x0 x1 x0 x1 x0 x1 x0 x1 0 0 1 1 0 0 1 1 1 0 0x1 0x0 1x1 1 0 0x0 0x1 1x0 1 0 0x1 1x0 1x1 1 1 31
  • 32. P Y C O N T W - 2 0 1 7 3 3 3 2 4 3 2 4 3x3 filter x1 x0 x1 x0 x1 x0 x1 x0 x1 0 0 1 1 0 0 1 1 1 0 0 0x1 1x0 1x1 0 0 0x0 1x1 1x0 0 0 1x1 1x0 1x1 1 32
  • 33. P Y C O N T W - 2 0 1 7 3 3 3 2 4 3 2 4 4 3x3 filter x1 x0 x1 x0 x1 x0 x1 x0 x1 0 0 1 1 0 0 1 1 1 0 0 0 1x1 1x0 0x1 0 0 1x0 1x1 0x0 0 1 1x1 1x0 1x1 33 Convolved Feature
  • 34. P Y C O N T W - 2 0 1 7 ref(2) : “cs231n : Covolutional Neural Networks for Visual Recognition”, Stanford A regular 3-layer Neural Network. ConvNet Architecture 34
  • 35. P Y C O N T W - 2 0 1 7 Sentence, Paragraph, Document? 35
  • 36. P Y C O N T W - 2 0 1 7 Convolutional Neural Networks for Sentence Classification ref(1) : “Convolutional Neural Networks for Sentence Classification”, 2014y 36 Using Text CNN filter - Save a locally information of text, sequential data, and context information
  • 37. P Y C O N T W - 2 0 1 7 Log2ML ( CNN ) 37
  • 38. P Y C O N T W - 2 0 1 7 Input Layer Conv. Layer Pooling Layer Fully- Connected Layer snmpd[1139]: Received TERM or STOP signal shutting down, fault caught SIGTERM shutting down, fault SIGHUP received Attempting to restart, fault sshd[2749]: Accepted password for pycon from 10.40.133.188 port 57463 ssh2, normal ntpdate[27169]: the NTP socket is in use exiting, normal Messages log : 38 fault normal category
  • 39. P Y C O N T W - 2 0 1 7 # To make an index for words use VocabularyProcess() function of Tensorflow vocab_processor = tf.contrib.learn.preprocessing.VocabularyProcessor(max_document_length) x_train = np.array(list(self.vocab_processor.fit_transform(x_train))) log example Input Layer Conv. Layer Pooling Layer Fully- Connected Layer 39
  • 40. P Y C O N T W - 2 0 1 7 embedding size vocab size : number of words Input Layer Conv. Layer Pooling Layer Fully- Connected Layer W = tf.Variable(tf.random_uniform([vocab_size, embedding_size], -1.0, 1.0), name=“W") embedded_chars = tf.nn.embedding_lookup(W, input_x) 40
  • 41. P Y C O N T W - 2 0 1 7 Input Layer Conv. Layer Pooling Layer Fully- Connected Layer filter_shape = [filter_size, embedding_size, 1, num_filters] W = tf.Variable(tf.truncated_normal(filter_shape, stddev=0.1), name="W") b = tf.Variable(tf.constant(0.1, shape=[num_filters]), name="b") conv = tf.nn.conv2d( self.embedded_chars_expanded, W, strides=[1, 1, 1, 1], padding="VALID", name=“conv") h = tf.nn.relu(tf.nn.bias_add(conv, b), name="relu") 41
  • 42. P Y C O N T W - 2 0 1 7 word V1 V2 V3 … Vp-2 Vp-1 Vp snmpd[1139]: Received TERM or … … signal shutting down filter Input Layer Conv. Layer Pooling Layer Fully- Connected Layer 42
  • 43. P Y C O N T W - 2 0 1 7 sliding word V1 V2 V3 … Vp-2 Vp-1 Vp snmpd[1139]: Received TERM or … … signal shutting down filter Input Layer Conv. Layer Pooling Layer Fully- Connected Layer 43
  • 44. P Y C O N T W - 2 0 1 7 word V1 V2 V3 … Vp-2 Vp-1 Vp snmpd[1139]: Received TERM or … … signal shutting down filter Input Layer Conv. Layer Pooling Layer Fully- Connected Layer 44
  • 45. P Y C O N T W - 2 0 1 7 word V1 V2 V3 … Vp-2 Vp-1 Vp snmpd[1139]: Received TERM or … … signal shutting down filter Input Layer Conv. Layer Pooling Layer Fully- Connected Layer 45
  • 46. P Y C O N T W - 2 0 1 7 word V1 V2 V3 … Vp-2 Vp-1 Vp snmpd[1139]: Received TERM or … … signal shutting down filter Input Layer Conv. Layer Pooling Layer Fully- Connected Layer 46
  • 47. P Y C O N T W - 2 0 1 7 word V1 V2 V3 … Vp-2 Vp-1 Vp snmpd[1139]: Received TERM or … … signal shutting down filter Input Layer Conv. Layer Pooling Layer Fully- Connected Layer 47
  • 48. P Y C O N T W - 2 0 1 7 word V1 V2 V3 … Vp-2 Vp-1 Vp snmpd[1139]: Received TERM or … … signal shutting down filter Input Layer Conv. Layer Pooling Layer Fully- Connected Layer 48 Finally, we get convolved feature
  • 49. P Y C O N T W - 2 0 1 7 word V1 V2 V3 … Vp-2 Vp-1 Vp snmpd[1139]: Received TERM or … … signal shutting down filter Input Layer Conv. Layer Pooling Layer Fully- Connected Layer 49 filter size : 4
  • 50. P Y C O N T W - 2 0 1 7 Input Layer Conv. Layer Pooling Layer Fully- Connected Layer pooled = tf.nn.max_pool( h, ksize=[1, sequence_length - filter_size + 1, 1, 1], strides=[1, 1, 1, 1], padding='VALID', name=“pool") # Combine all the pooled features num_filters_total = num_filters * len(filter_sizes) self.h_pool = tf.concat(3, pooled_outputs) self.h_pool_flat = tf.reshape(self.h_pool, [-1, num_filters_total]) 50
  • 51. P Y C O N T W - 2 0 1 7 Input Layer Conv. Layer Pooling Layer Fully- Connected Layer with tf.name_scope("output"): W = tf.get_variable( "W", shape=[num_filters_total, num_classes], initializer=tf.contrib.layers.xavier_initializer()) b = tf.Variable(tf.constant(0.1, shape=[num_classes]), name="b") l2_loss += tf.nn.l2_loss(W) l2_loss += tf.nn.l2_loss(b) self.scores = tf.nn.xw_plus_b(self.h_drop, W, b, name="scores") self.predictions = tf.argmax(self.scores, 1, name="predictions") 51
  • 52. P Y C O N T W - 2 0 1 7 Convolutional Neural Networks for Sentence Classification 52
  • 53. P Y C O N T W - 2 0 1 7 $ tensorboard --logdir ./runs/1496236844/summaries 53
  • 54. P Y C O N T W - 2 0 1 754
  • 55. P Y C O N T W - 2 0 1 7 End Reference (1) “Convolutional Neural Networks for Sentence Classification”, Yoon Kim, 2014y (2) “cs231n : Covolutional Neural Networks for Visual Recognition”, Stanford 55