code: func (n *Parser) getTimestamp(evMap map[string]interface{}) time.Time {
  	var (
  		setBothFieldsMsg = "Timestamp format and field must both be set to be used, one was not. Using current time instead."
  	)
  
  	// Custom (user-defined) timestamp field/format takes priority over the
  	// default parsing behavior. Try that first.
  	if n.conf.TimeFieldFormat != "" || n.conf.TimeFieldName != "" {
  		if n.conf.TimeFieldFormat == "" || n.conf.TimeFieldName == "" {
  			logrus.Debug(setBothFieldsMsg)
  			return httime.Now()
  		}
  		return httime.GetTimestamp(evMap, n.conf.TimeFieldName, n.conf.TimeFieldFormat)
  	}
  
  	if _, ok := evMap["time_local"]; ok {
  		return httime.GetTimestamp(evMap, "time_local", commonLogFormatTimeLayout)
  	}
  
  	if _, ok := evMap["time_iso8601"]; ok {
  		return httime.GetTimestamp(evMap, "time_iso8601", iso8601TimeLayout)
  	}
  
  	if _, ok := evMap["msec"]; ok {
  		return httime.GetTimestamp(evMap, "msec", "")
  	}
  
  	return httime.GetTimestamp(evMap, "", "")
  }
docs: // tries to extract a timestamp from the log line