This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:5.3.0 | |
container_name: elasticsearch | |
environment: | |
- cluster.name=docker-cluster | |
- bootstrap.memory_lock=true | |
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import traceback | |
import couchdb | |
couch = couchdb.Server('http://admin:[email protected]:5984/') | |
try: | |
db = couch.create('test1') | |
except Exception, e: | |
traceback.print_exc() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
import urllib | |
import gzip | |
import os | |
import time | |
import re | |
url_base = 'http://www1.ncdc.noaa.gov/pub/data/noaa/{}' | |
ext = 'gz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.base.Stopwatch; | |
import org.apache.log4j.Level; | |
import org.apache.log4j.Logger; | |
import java.util.Random; | |
import java.util.concurrent.TimeUnit; | |
public class Log4jRecordGenerator { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reading log4j records with layout %d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}\u001F%p\u001F%m%n | |
# need to use message generator that adds sequence number to position 2 | |
import backtype.storm.Config; | |
import backtype.storm.LocalCluster; | |
import backtype.storm.spout.SchemeAsMultiScheme; | |
import backtype.storm.topology.BasicOutputCollector; | |
import backtype.storm.topology.OutputFieldsDeclarer; | |
import backtype.storm.topology.TopologyBuilder; | |
import backtype.storm.topology.base.BaseBasicBolt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name the components on this agent | |
a1.sources = r1 | |
a1.sinks = k1 | |
a1.channels = c1 | |
a1.sources.r1.type = exec | |
a1.sources.r1.command = tail -F /var/log/example.log | |
a1.sources.r1.channels = c1 | |
a1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink |