igraph is used to visualize network based on same user login on multiple hosts and ggplot is used to create statistical aalysis from the data set on diffrent category of events for hosts and user.
x<-read.csv('july.csv')
y<-c("Target.Host.Name","Target.User.Name")
z<-x[y]
z_df <- as.data.frame.matrix(table(z))
z2<-replace(z_df,z_df >= 1, 1)
z3<-as.matrix(z2)
terma<-z3 %*% t(z3)
library(igraph)
library(tcltk)
g<-graph.adjacency(terma,weighted=T,mode="undirected")
g<-simplify(g)
V(g)$label<-V(g)$name
V(g)$degree<-degree(g)
set.seed(3456)
tkplot(g, layout=layout.kamada.kawai)
## [1] 1
plot(g, layout=layout.kamada.kawai)
library(ggplot2)
library(gridExtra)
## Warning: package 'gridExtra' was built under R version 3.1.1
## Loading required package: grid
y<-c("Target.Host.Name","Target.User.Name","Category.Behavior","Category.Outcome")
m<-x[y]
colnames(m)<-c("targethost","targetuser","categorybehavior","categoryoutcome")
p1<-ggplot(aes(x=targethost),
data = subset(m,categorybehavior %in% c("/Modify/Attribute") & categoryoutcome%in% c("/Success") ))+
geom_histogram(color =I('black'),fill = I('#099009'))+
theme(axis.text.x=element_text(angle=30,hjust=1,vjust=1))+
ggtitle('Distribution of Hosts for Attribution Modification Success events')
p2<-ggplot(aes(x=targetuser),
data = subset(m,categorybehavior %in% c("/Authentication/Verify") & categoryoutcome%in% c("/Failure") ))+
geom_histogram(color =I('black'),fill = I('#099009'))+
theme(axis.text.x=element_text(angle=30,hjust=1,vjust=1))+
ggtitle('Distribution of Target Users for Authentication Failure events')
grid.arrange(p1,p2,ncol=1)