Login using Social Account
     Continue with GoogleLogin using your credentials
The following steps are needed in order to setup windows dev machine:
cd c:\Users\MY_WINDOWS_USERNAME\Documents\GitHub\bigdata\spark\projects\apache-log-parsing_sbt
sbt test
on command promptInstall eclipse:
Create eclipse project using sbt eclipse plugin: https://github.com/typesafehub/sbteclipse
With sublime texteditor, edit C:/Users/myuser/.sbt/1.0/plugins/plugins.sbt
And add following to it or whatever is mentioned on sbteclipse github homepage:
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.2")
Re-Open command prompt and go to the project folder:
cd c:\Users\MY_WINDOWS_USERNAME\Documents\GitHub\bigdata\spark\projects\apache-log-parsing_sbt
sbt eclipse
In Utils, add:
def isClassA(ip:String):Boolean = { ip.split('.')(0).toInt < 127 }
In log-parser-test.scala, add a unit test case:
"CLASSA" should "Return true if class is A" in { val utils = new Utils assert(utils.isClassA("121.242.40.10 ")) assert(!utils.isClassA("212.242.40.10 ")) assert(!utils.isClassA("239.242.40.10 ")) assert(!utils.isClassA("191.242.40.10 ")) }
In log-parser-test.scala, add a filter after extracting the IP :
var cleanips = ipaccesslogs.map(extractIP(_))
var cleanips = ipaccesslogs.map(extractIP(_)).filter(isClassA)
spark-submit apache-log-parsing_2.10-0.0.1.jar com.cloudxlab.logparsing.EntryPoint 10 /data/spark/project/access/access.log.45.gz
Loading comments...