~shabbyrobe/dogdump

7aa1d96f1bcdb29a0b4c3796661ebe53ad7cb7d8 — Blake Williams 6 days ago ee51733 master
Fix time overwriting in log handler, Message can be anything
2 files changed, 4 insertions(+), 3 deletions(-)

M doglog/v2entry.go
M doglog/v2handler.go
M doglog/v2entry.go => doglog/v2entry.go +2 -1
@@ 27,7 27,8 @@ type IntakeEntryV2 struct {
	// The message [reserved attribute](https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#reserved-attributes)
	// of your log. By default, Datadog ingests the value of the message attribute as the body of the log entry.
	// That value is then highlighted and displayed in the Logstream, where it is indexed for full text search.
	Message string `json:"message,omitempty"`
	// NOTE: Can be any json serializable value, will frequently be an object:
	Message any `json:"message,omitempty"`

	// The name of the application or service generating the log events.
	// It is used to switch from Logs to APM, so make sure you define the same value when you use both products.

M doglog/v2handler.go => doglog/v2handler.go +2 -2
@@ 133,8 133,6 @@ func (h *HTTPIntakeV2Routes) handleLogsApplicationJSON(body io.Reader, w http.Re
		}

		var entry IntakeEntryV2
		entry.At = now
		entry.LogType = "log"
		if err := entry.Parse(rawEntry); err != nil {
			if handleErr := h.errHandler(err); handleErr != nil {
				panic(handleErr)


@@ 142,6 140,8 @@ func (h *HTTPIntakeV2Routes) handleLogsApplicationJSON(body io.Reader, w http.Re
			http.Error(w, error400Body, http.StatusBadRequest)
			return
		}
		entry.At = now
		entry.LogType = "log"

		if err := h.entryHandler(r.Context(), entry); err != nil {
			if handleErr := h.errHandler(err); handleErr != nil {