Posts

how to reset file parse in Logstash? -

many questions have been seen here in stackoverflow on similar subject this question . none of them helped reset logstash. i've used: input { file { path => ["/var/log/nginx/access.log"] start_position => "beginning" } } i've read .sincedb can set. don't have these files think unnecessary set file path that. is there other place reset logstash? why such simple method hard do? edit1: i've tried sincedb_path /dev/null this question has been said. again read today not beginning of log file. you can hand modifying .sincedb file. according documentation : sincedb files text files 4 columns: 1. inode number (or equivalent). 2. major device number of file system (or equivalent). 3. minor device number of file system (or equivalent). 4. current byte offset within file. so if change last number 0 restart file @ beginning.

javascript - How to retrieve groupby sum field to show balloonText in Amchart -

Image
i newbie in amcharts, please tell me doing wrong. here javascript code. var chartdata1 = []; generatechartdata(); function generatechartdata() { var month = new array(); month[0] = "jan"; month[1] = "feb"; month[2] = "mar"; month[3] = "apr"; month[4] = "may"; month[5] = "jun"; month[6] = "jul"; month[7] = "aug"; month[8] = "sep"; month[9] = "oct"; month[10] = "nov"; month[11] = "dec"; (var = 0; < 12; i++) { var monthname = month[i]; var year = "2016"; var newdateformat = monthname + " " + year ; var numofdocuments = math.round(math.random() * (10)); var amount = math.round(math.random() * (1000 + i)) + 500 + * 2; chartdata1.push({ chartcol: newdateformat, v...

linux - Find X occurence of string in file and replace to static string -

i need again. need find 3 , 4 occurrence of comma (accross line) , replace specific string, let's assume: "text","text2","text3","text4","text5" "text6","text7","text8","text9","text10" now, replace text4,text9,text5,text10 eg. "static" "text","text2","text3","static","static" "text6","text7","text8","static","static" which function should use? know 'sed' proper that, how count commas? edit: (simpler version 3 occurence of comma) i need find 3 occurrence of comma (accross line) , replace specific string, let's assume: "text","text2","text3","text4","text5" "text6","text7","text8","text9","text10" now, replace text4,text9 eg. "static" ...

Applying joins conditionally in SQL Server -

i have set of records, have select records set have theeir id in either of 2 tables. suppose have table1 contains id name ---------- 1 name1 2 name2 now need select records table 1 have either id in table2 or in table3 i trying apply or operator witin inner join like: select * table1 inner join table2 on table2.id = table1.id or inner join table3 on table3.id = table1.id. is possible? best method approach this? not able use if exist(select 1 table2 id=table1.id) select table1 could me on this? i inclined use exists : select t1.* table1 t1 exists (select 1 table2 t2 t2.id = t1.id) or exists (select 1 table3 t3 t3.id = t1.id) ; the advantage using exists (or in ) on join involves duplicate rows. if table2 or table3 have multiple rows given id , version using join produce multiple rows in result set.

Create JavaRDD from list in Spark 2.0 -

the usual way of creating javardd list use javasparkcontext.parallelize(list) however, in spark 2.0 sparksession used entry point , don't know how create javardd list solution: spark-shell (spark 2.0) import org.apache.spark.api.java.javasparkcontext val jsc = new javasparkcontext(sc) val javardd:java.util.list[int]= java.util.arrays.aslist(1, 2, 3, 4, 5) jsc.parallelize(javardd) spark programming guide

How to filter out "_id" from mongodb C driver results -

i have been going through documentation , i'm still lost on how filter out _id results mongodb using c driver. want functionality i'm not sure db.collection.find({"test":"pass"},{_id: false}); how include projection in c? cursor = mongoc_collection_find (collection, mongoc_query_none, 0, 0, 0, query, null, null); after bit of trial , error able add flags search query. else here format appending no id flag mongoc search. bson_t *field = bson_new(); bson_append_int32(field,"_id", 0); to search pattern like cursor = mongoc_collection_find (collection, mongoc_query_none, 0, 0, 0, query, field, null);

sitecore - Error deploying solution using Octopus deploy -

i have web project written in sitecore 8/ucommerce. using teamcity compile , package project , octopus deploy push out. when commit svn teamcity picks changes, compiles , packages , octopus deploys dev environment. works well. when try promote test error... error running conventions; running failure conventions... fatal 10:24:19 deployment on tentacle failed. in project have post deploy script ( postdeploy.ps1 ) remove unwanted config files. there 1 line... .\deleteconfig.exe $octopusenvironmentname i changed from.. .\deleteconfig.exe $octopusparameters['octopus.environment.name'] due article read, hasn't changed error. have tried.. .\deleteconfig.exe $octopusparameters['octopusenvironmentname'] again no effect. if comment out line of code no longer error. i have been trying fix sometime now, read , followed articles , post can find on problem cannot find fix. a slight curveball second project deploy in way. first sitecore/ucom...