code: func (l *FileLog) SearchSessionEvents(fromUTC, toUTC time.Time, limit int) ([]EventFields, error) {
  	l.Debugf("SearchSessionEvents(%v, %v, %v)", fromUTC, toUTC, limit)
  
  	// only search for specific event types
  	query := url.Values{}
  	query[EventType] = []string{
  		SessionStartEvent,
  		SessionEndEvent,
  	}
  
  	// because of the limit and distributed nature of auth server event
  	// logs, some events can be fetched with session end event and without
  	// session start event. to fix this, the code below filters out the events without
  	// start event to guarantee that all events in the range will get fetched
  	events, err := l.SearchEvents(fromUTC, toUTC, query.Encode(), limit)
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	// filter out 'session end' events that do not
  	// have a corresponding 'session start' event
  	started := make(map[string]struct{}, len(events)/2)
  	filtered := make([]EventFields, 0, len(events))
  	for i := range events {
  		event := events[i]
  		eventType := event[EventType]
  		sessionID := event.GetString(SessionEventID)
  		if sessionID == "" {
  			continue
  		}
  		if eventType == SessionStartEvent {
  			started[sessionID] = struct{}{}
  			filtered = append(filtered, event)
  		}
  		if eventType == SessionEndEvent {
  			if _, ok := started[sessionID]; ok {
  				filtered = append(filtered, event)
  			}
  		}
  	}
  
  	return filtered, nil
  }
docs: // SearchSessionEvents searches for session related events. Used to find completed sessions.