You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Implement more format on Loki writer
- Implement same formats as stdout writer (printf, json, fields)
- Allow reordering json keys
- Refactor and add more tests
* regen doc
* fix nil format
Copy file name to clipboardExpand all lines: docs/api.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -321,6 +321,8 @@ Following is the supported API format for writing to loki:
321
321
clientConfig: clientConfig
322
322
timestampLabel: label to use for time indexing
323
323
timestampScale: timestamp units scale (e.g. for UNIX = 1s)
324
+
format: the format of each line: printf (writes using golang's default map printing), fields (writes one key and value field per line) or json (default)
325
+
reorder: reorder json map keys
324
326
</pre>
325
327
## Write Standard Output
326
328
Following is the supported API format for writing to standard output:
Copy file name to clipboardExpand all lines: pkg/api/write_loki.go
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@ type WriteLoki struct {
44
44
// scales of '1ms' (one millisecond) or just '1' (one nanosecond)
45
45
// Default value is '1s'
46
46
TimestampScalestring`yaml:"timestampScale,omitempty" json:"timestampScale,omitempty" doc:"timestamp units scale (e.g. for UNIX = 1s)"`
47
+
Formatstring`yaml:"format,omitempty" json:"format,omitempty" doc:"the format of each line: printf (writes using golang's default map printing), fields (writes one key and value field per line) or json (default)"`
0 commit comments