Have existing document already in ES
{
"service" : "A",
"timestamp" : "2014-06-06T12:12:59.456+00:00"
}
and want to update it to get this
(ns core | |
(:require | |
[clojurewerkz.elastisch.rest.document :as doc] | |
[clojurewerkz.elastisch.rest :as esr] | |
[clojurewerkz.elastisch.query :as q] | |
[clojurewerkz.elastisch.rest.response :as esrsp])) | |
(defn move-documents [conn <-index scroll-id] | |
(let [;; scroll query - step 2 | |
scan-response (doc/scroll conn scroll-id :scroll "1m") |
(ns ast) | |
(def ast-eval | |
(memoize | |
(fn | |
([expr] | |
(if (vector? expr) | |
(let [head-sym (first expr)] | |
(cond | |
(number? head-sym) head-sym |
(ns core | |
(:require [cheshire.core :as j])) | |
(defn -main [& args] | |
(println "Hello, World!")) |
(ns configuration | |
(:require [logomotive.api.input :as input] | |
[logomotive.api.output :as output] | |
[logomotive.api.transform :as transform] | |
)) | |
; Read events from stdin, keep it as-is | |
(input/stdin {:format :plain}) | |
; Read events from UDP on port 1984, keep it as-is |
;; This is a function that needs 'resource' started/stopped by the component | |
(defn index-create [name] | |
(let [conn (esr/connect (es-url) {:connection-manager __HOW_TO_PASS_COMPONENT_HERE__})] | |
(esi/create conn name) | |
)) | |
;; A component that takes care of starting and stopping and stopping http connection manager |
Have existing document already in ES
{
"service" : "A",
"timestamp" : "2014-06-06T12:12:59.456+00:00"
}
and want to update it to get this
Given the document
curl -XPUT 'localhost:9200/test/me/here' -d '{
"top" : [
{ "searchkey" : "change"},
{ "searchkey" : "keep"}
]
}'
import multiprocessing | |
import time | |
import os | |
class PMonitor(multiprocessing.Process): | |
def __init__(self, process_id): | |
super(PMonitor, self).__init__() | |
self.process_id = str(process_id) | |
self.semaphore = multiprocessing.Event() |
import os | |
import glob | |
import twitter.common.java.perfdata as twc | |
if __name__ == '__main__': | |
pattern = os.path.join('/tmp', 'hsperfdata_*', '*') | |
for path in glob.glob(pattern): | |
root, pid = os.path.split(path) | |
dirname = os.path.basename(root) |
# PATHS | |
WORKBENCH=~/Workbench | |
PATH=~/bin:${PATH} | |
JAVA_HOME=/usr/java/latest/ | |
PATH=${JAVA_HOME}:${PATH} | |
TMP=/tmp; export TMP | |
TMPDIR=$TMP; export TMPDIR |