Skip to content

Instantly share code, notes, and snippets.

{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum errors before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : true,
Query =
GET /products/product/_search
{
"query": {
"match_all" : {}
},
"aggs" : {
"group_by_scode" : {
"terms" : {
"field" : "SCODE"
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 6,
GET /products/product/_search
{
"query": {
"match_all" : {}
},
"aggs" : {
"group_by_scode" : {
"terms" : {
"field" : "SCODE"
}
org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
input {
tcp {
port => 8000
type => access_log
}
}
filter {
index.js?_b=6004:45725 bootstrap
index.js?_b=6004:45725 es check
index.js?_b=6004:45725 config init
index.js?_b=6004:45620 Error: Uncaught SyntaxError: Unexpected token p (http://184.170.226.245:5601/#/settings/indices/?_g=():1)
at window.onerror (index.js?_b=6004:45829)
(index):1 Uncaught SyntaxError: Unexpected token p
index.js?_b=6004:45584 Uncaught Error: Uncaught SyntaxError: Unexpected token p (http://184.170.226.245:5601/#/settings/indices/?_g=():1)
index.js?_b=6004:45721 complete in 151.86ms
mkfifo ./tail_logs
tail -F --lines=0 /home/ua/.forever/v6-b2c-0.log | awk '{print "[app_log_0] - " $0}' > ./tail_logs &
tail -F --lines=0 /home/ua/.forever/v6-b2c-1.log | awk '{print "[app_log_1] - " $0}' > ./tail_logs &
tail -F --lines=0 /home/ua/.forever/v6-b2c-2.log | awk '{print "[app_log_2] - " $0}' > ./tail_logs &
tail -F --lines=0 /home/ua/.forever/v6-b2c-3.log | awk '{print "[app_log_3] - " $0}' > ./tail_logs &
nc -u X.X.X.X 8008 < ./tail_logs

Question on node ChildProcess.spawn

My question is regarding the node spawn interface... I was under the impression that you could use the stdio field of the option argument to give yourself a way to redirect data to/from a child process (e.g [Readable -> child.stdin, child.stdout -> Writeable Stream, child.stderr -> Writeable stream])

My question is why can I not provide a writeable stream as the second index in the array I am passing for this field. When I do I get the error: "TypeError: Incorrect value for stdio stream: [object Object]"

why does this work??

var spawn = require("child_process").spawn;
var args = "-F --lines=0 /Users/choover/workspace/sandbox/forwarding-agent/test/test.log"
// grok pattern
\[checkout\] Checkout (?<action>\w+) - (?<checkout_type>[^-]+)(?: - \[(?<total>[0-9\.]+)\]$)?
// grok pattern with grok pattern substitution
\[checkout\] Checkout %{WORD:action} - (?<checkout_type>[^-]+)(?: - \[%{NUMBER:total}\]$)?
// log entries
[b2c_web] [app2] [b2c-3774016-5092740] - 2015-04-14T16:41:30.626Z - info: [checkout] Checkout attempt - new credit card - [158.99]
[b2c_web] [app2] [b2c-3774016-5092740] - 2015-04-14T16:41:33.284Z - info: [checkout] Checkout success - new credit card - [158.99]
[b2c_web] [app0] [b2c-3774016-5092740] - 2015-04-14T16:43:25.468Z - info: [checkout] Checkout attempt - new credit card - [158.94]