Simpler JSON.
This commit is contained in:
parent
6c213828a4
commit
4570046da6
1 changed files with 2 additions and 4 deletions
|
@ -160,13 +160,11 @@ query: >
|
|||
Line: fmt.Sprintf("Log line #%d", i),
|
||||
}
|
||||
}
|
||||
buff := &bytes.Buffer{}
|
||||
encoder := json.NewEncoder(buff)
|
||||
err := encoder.Encode(streams)
|
||||
buff, err := json.Marshal(streams)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
resp, err := http.Post("http://127.0.0.1:3100/loki/api/v1/push", "application/json", buff)
|
||||
resp, err := http.Post("http://127.0.0.1:3100/loki/api/v1/push", "application/json", bytes.NewBuffer(buff))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue