title: Produce Elasticsearch query output based on field value match, sequence and limited time frame
body: <p>How do I search an index for two different message texts and then only filter out the two messages that happened in the same second?</p>
  <p>f.ex. message: &quot;first message&quot; and message: &quot;second message&quot;
  (only display index entries containing first message followed by entry with second message, if the log entries occurred within 1sec of one another).</p>
  <p><strong>Acceptable output:</strong></p>
  <p>2020-12-18T20:26:58.089Z [INF]:First message</p>
  <p>2020-12-18T20:26:58.184Z [ERR]:Second message</p>
  <p><strong>Not acceptable output:</strong></p>
  <p>(too much time between index entry 1 and index entry 2 greater than 1s)</p>
  <p>2020-12-18T20:26:58.089Z [INF]:First message</p>
  <p>2020-12-18T20:26:59.184Z [ERR]:Second message</p>
  <p>(wrong sequence of events)</p>
  <p>2020-12-18T20:26:58.184Z [ERR]:Second message</p>
  <p>2020-12-18T20:26:59.089Z [INF]:First message</p>
  <p>What would the query look like that produces a result set containing all matching pairs of events that happened within 1sec of each other?</p>