diff --git a/README.md b/README.md index d2e414f..c47fcc3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![Travis Build Badge](https://travis-ci.org/FTWynn/gologgen.svg?branch=master) ![Go report card](http://goreportcard.com/badge/ftwynn/gologgen) -#### Current Release: [2.4.0](https://github.com/FTWynn/gologgen/releases/tag/v2.4.0) - 2/4/2016 +#### Current Release (Big Config Change): [2.5.0](https://github.com/FTWynn/gologgen/releases/tag/v2.5.0) - 2/12/2016 gologgen is a generic log generator written in go. I'm writing it because I want to learn golang, and there was a need for a universal, well documented fake log generator at my job. All feedback is greatly appreciated. @@ -44,7 +44,7 @@ A Data File is a JSON description of log lines. The parameters for each are belo DataFile Parameter | Notes --------- | ----- -Text | Log message to write. The text is always interpreted literally except for the three wildcard segments: $[time,stamp], $[integer,integer], and $[string,string,...]. The first inserts the timestamp at the location. The second inserts a random integer between the two values. The third picks a random string and inserts it. +Text | Log message to write. The text is always interpreted literally except for the three wildcard segments: $[time||stamp], $[integer||integer], and $[string||string||...]. The first inserts the timestamp at the location. The second inserts a random integer between the two values. The third picks a random string and inserts it. IntervalSecs | Interval in seconds to repeat the message. The minimum value is 1. IntervalStdDev | Standard Deviation of the Interval if you want to add some randomness. Specified as a float. TimestampFormat | The timestamp format to write on the message. See note below. diff --git a/config/datafile_examples/gologgen.data b/config/datafile_examples/gologgen.data index 2e9b005..a710b11 100644 --- a/config/datafile_examples/gologgen.data +++ b/config/datafile_examples/gologgen.data @@ -1,7 +1,7 @@ { "lines" : [ { - "Text" : "$[time,stamp] Test Random Numbers: $[0,5] $[8,10]", + "Text" : "$[time||stamp] Test Random Numbers: $[0||5] $[8||10]", "IntervalSecs" : 4, "IntervalStdDev" : 0.5, "TimestampFormat" : "Jan 02 15:04:05", @@ -17,7 +17,7 @@ ] }, { - "Text" : "$[time,stamp] Test Random Category: $[Post,Thing,Stuff]", + "Text" : "$[time||stamp] Test Random Category: $[Post||Thing||Stuff]", "IntervalSecs" : 4, "IntervalStdDev" : 1, "TimestampFormat" : "epoch", @@ -49,7 +49,7 @@ ] }, { - "Text" : "$[time,stamp] Rock Solid Repeater", + "Text" : "$[time||stamp] Rock Solid Repeater", "IntervalSecs" : 5, "IntervalStdDev" : 0, "StartTime" : "12:03:01", diff --git a/loggenmunger/loggenmunger.go b/loggenmunger/loggenmunger.go index 1b0552b..415761f 100644 --- a/loggenmunger/loggenmunger.go +++ b/loggenmunger/loggenmunger.go @@ -87,7 +87,7 @@ func getOneToken(tokenString string, timeformat string) (string, error) { }).Debug("Removing the formatting from the item list") // Split the randomizer into individual items - itemList := strings.Split(tempstring, ",") + itemList := strings.Split(tempstring, "||") log.WithFields(log.Fields{ "itemList": itemList, "count": len(itemList),