-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
392 changed files
with
43,804 additions
and
3,464 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const express = require('express'); | ||
const app = express(); | ||
const port = process.env.PORT || 3000; | ||
const fs = require('fs'); | ||
const promisify = require('util').promisify; | ||
const filename = './logisland.json'; | ||
const bodyParser = require('body-parser'); | ||
|
||
app.use(bodyParser.json()); | ||
app.listen(port); | ||
|
||
const routes = { | ||
|
||
getDataflows: async function(req, res) { | ||
console.log("Updating dataflow for logisland job", req.params.jobId); | ||
let content = JSON.parse(await promisify(fs.readFile)(filename)); | ||
let fileDate = (await promisify(fs.stat)(filename)).mtime; | ||
res.append('Last-Modified', fileDate.toUTCString()).json(content); | ||
}, | ||
|
||
notifyActiveDataflows: function(req, res) { | ||
console.log("Logisland active dataflows for job", req.params.jobId); | ||
console.log(JSON.stringify(req.body)); | ||
res.sendStatus(200); | ||
} | ||
}; | ||
|
||
app.route('/dataflows/:jobId') | ||
.get(routes.getDataflows) | ||
.post(routes.notifyActiveDataflows); | ||
|
||
console.log('Logisland RESTful API server started on: ' + port); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"lastModified": "2018-06-30T10:00:24Z", | ||
|
||
"streams": [{ | ||
"name": "kafka_in", | ||
"component": "com.hurence.logisland.stream.spark.KafkaRecordStreamParallelProcessing", | ||
"config": [{ | ||
"key": "kafka.input.topics", | ||
"value": "logisland_raw" | ||
}, | ||
|
||
{ | ||
"key": "kafka.output.topics", | ||
"value": "logisland_events" | ||
}, | ||
{ | ||
"key": "kafka.error.topics", | ||
"value": "logisland_errors" | ||
}, | ||
{ | ||
"key": "kafka.input.topics.serializer", | ||
"value": "none" | ||
}, | ||
{ | ||
"key": "kafka.output.topics.serializer", | ||
"value": "com.hurence.logisland.serializer.KryoSerializer" | ||
}, | ||
{ | ||
"key": "kafka.error.topics.serializer", | ||
"value": "com.hurence.logisland.serializer.JsonSerializer" | ||
}, | ||
{ | ||
"key": "kafka.metadata.broker.list", | ||
"value": "sandbox:9092" | ||
}, | ||
{ | ||
"key": "kafka.zookeeper.quorum", | ||
"value": "sandbox:2181" | ||
}, | ||
{ | ||
"key": "kafka.topic.autoCreate", | ||
"value": "true" | ||
}, | ||
{ | ||
"key": "kafka.topic.default.partitions", | ||
"value": "4" | ||
}, | ||
{ | ||
"key": "kafka.topic.default.replicationFactor", | ||
"value": "1" | ||
} | ||
], | ||
"pipeline": { | ||
"lastModified": "2018-05-30T12:02:35Z", | ||
"processors": [{ | ||
"component": "com.hurence.logisland.processor.SplitText", | ||
"name": "apache_parser", | ||
"documentation": "parse apache logs with a regexp", | ||
"config": [ | ||
{ | ||
"key": "record.type", | ||
"value": "apache_logs" | ||
}, | ||
{ | ||
"key": "value.regex", | ||
"value": "(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+\\[([\\w:\\/]+\\s[+\\-]\\d{4})\\]\\s+\"(\\S+)\\s+(\\S+)\\s*(\\S*)\"\\s+(\\S+)\\s+(\\S+)" | ||
}, | ||
{ | ||
"key": "value.fields", | ||
"value": "src_ip,identd,user,record_time,http_method,http_query,http_version,http_status,bytes_out" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "outLog", | ||
"component": "com.hurence.logisland.processor.DebugStream", | ||
"config": [{ | ||
"key": "event.serializer", | ||
"value": "json" | ||
}] | ||
|
||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.