Skip to content

Commit

Permalink
Changed token separator from , to ||
Browse files Browse the repository at this point in the history
  • Loading branch information
FTWynn committed Feb 13, 2016
1 parent 1c1f09a commit 18845ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions config/datafile_examples/gologgen.data
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -49,7 +49,7 @@
]
},
{
"Text" : "$[time,stamp] Rock Solid Repeater",
"Text" : "$[time||stamp] Rock Solid Repeater",
"IntervalSecs" : 5,
"IntervalStdDev" : 0,
"StartTime" : "12:03:01",
Expand Down
2 changes: 1 addition & 1 deletion loggenmunger/loggenmunger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 18845ea

Please sign in to comment.