1 comment

  • Avatar
    msgroi msgroi

    Make sure your pattern layout begins with the proper date format, otherwise the default behavior of the ingest is to search for dates in your message string.  Per Sumo support, for the logback appender the correct date format is ...


    If this is left out or is incorrect, then this can result in messages being assigned incorrect message times at ingest which means you won't see them in queries in the expected timeframe(unless you specify "Use Receipt Time").  Note that you're free to modify the pattern layout after the date string.  Also, I haven't tested anything beyond the default settings, I believe you have flexibility here with respect to how message times are set and what date format is used on ingest, according to this ...

    The following query will show you if you have messages where the receipt time and message time are off by more than a minute.

    // be sure to click "Use Receipt Time" when running this query
    * |
    _receiptTime as receipttime_ms |
    _messageTime as messagetime_ms |
    messagetime_ms - receipttime_ms as diff_ms |
    if(diff_ms < 0, diff_ms * -1, diff_ms) as absolute_time_diff_ms |
    where absolute_time_diff_ms > 2 * 60 * 1000000 |
    timeslice 1d |
    formatDate(_timeslice, "yyyy-MM-dd") as day |
    count as count, min(receipttime_ms) as oldest_receiptime_ms, max(receipttime_ms) as latest_receiptime_ms, min(absolute_time_diff_ms) as min_time_diff_ms, max(absolute_time_diff_ms) as max_time_diff_ms group by day, _sourceName |
    formatDate(fromMillis(toLong(oldest_receiptime_ms)), "yyyy-MM-dd HH:mm:ss.SSS") as oldest |
    formatDate(fromMillis(toLong(latest_receiptime_ms)), "yyyy-MM-dd HH:mm:ss.SSS") as latest |
    round(min_time_diff_ms / (1000 * 60)) as min_time_diff_minutes |
    round(max_time_diff_ms / (1000 * 60)) as max_time_diff_minutes |
    fields day, _sourceName, count, oldest, latest, min_time_diff_minutes, max_time_diff_minutes |
    sort by day desc, _sourceName

    Comment actions Permalink

Please sign in to leave a comment.