@@ -713,6 +713,8 @@ logline_value_vector::clear()
713713{
714714 this ->lvv_values .clear ();
715715 this ->lvv_sbr .disown ();
716+ this ->lvv_time_value = std::nullopt ;
717+ this ->lvv_time_exttm = std::nullopt ;
716718 this ->lvv_opid_value = std::nullopt ;
717719 this ->lvv_opid_provenance = opid_provenance::none;
718720 this ->lvv_thread_id_value = std::nullopt ;
@@ -723,6 +725,8 @@ logline_value_vector::clear()
723725
724726logline_value_vector::logline_value_vector (const logline_value_vector& other)
725727 : lvv_sbr(other.lvv_sbr.clone()), lvv_values(other.lvv_values),
728+ lvv_time_value(other.lvv_time_value),
729+ lvv_time_exttm(other.lvv_time_exttm),
726730 lvv_opid_value(other.lvv_opid_value),
727731 lvv_opid_provenance(other.lvv_opid_provenance),
728732 lvv_thread_id_value(
@@ -740,6 +744,8 @@ logline_value_vector::operator=(const logline_value_vector& other)
740744{
741745 this ->lvv_sbr = other.lvv_sbr .clone ();
742746 this ->lvv_values = other.lvv_values ;
747+ this ->lvv_time_value = other.lvv_time_value ;
748+ this ->lvv_time_exttm = other.lvv_time_exttm ;
743749 this ->lvv_opid_value = other.lvv_opid_value ;
744750 this ->lvv_opid_provenance = other.lvv_opid_provenance ;
745751 this ->lvv_thread_id_value
@@ -2407,6 +2413,7 @@ external_log_format::annotate(logfile* lf,
24072413 auto ts_cap = md[pat.p_timestamp_field_index ];
24082414 if (ts_cap) {
24092415 sa.emplace_back (to_line_range (ts_cap.value ()), L_TIMESTAMP .value ());
2416+ values.lvv_time_value = ts_cap;
24102417 }
24112418
24122419 auto opid_cap = md[pat.p_opid_field_index ];
@@ -2859,6 +2866,7 @@ rewrite_json_field(yajlpp_parse_context* ypc,
28592866 sql_strftime (
28602867 time_buf, sizeof (time_buf), jlu->jlu_line ->get_timeval (), ' T' );
28612868 }
2869+ jlu->jlu_format ->jlf_line_values .lvv_time_value = frag;
28622870 jlu->jlu_format ->jlf_line_values .lvv_values .emplace_back (
28632871 jlu->jlu_format ->get_value_meta (field_name,
28642872 value_kind_t ::VALUE_TEXT ),
@@ -3025,7 +3033,7 @@ external_log_format::get_subline(const log_format_file_state& lffs,
30253033 } else {
30263034 std::vector<logline_value>::iterator lv_iter;
30273035 bool used_values[this ->jlf_line_values .lvv_values .size ()];
3028- struct line_range lr;
3036+ line_range lr;
30293037
30303038 memset (used_values, 0 , sizeof (used_values));
30313039 for (lv_iter = this ->jlf_line_values .lvv_values .begin ();
@@ -3034,6 +3042,9 @@ external_log_format::get_subline(const log_format_file_state& lffs,
30343042 {
30353043 lv_iter->lv_meta .lvm_format = this ;
30363044 }
3045+ if (!this ->jlf_line_values .lvv_time_value ) {
3046+ this ->jlf_line_values .lvv_time_exttm = jlu.jlu_exttm ;
3047+ }
30373048
30383049 if (jlu.jlu_tid_number ) {
30393050 char tid_buf[128 ];
0 commit comments