Let's call this scripted field date_diff. This would give you the number of milliseconds between your two dates. Since 4 hours is equivalent to 14400000 milliseconds, you could then do a search like this (assuming you're using KQL, not Lucene, as Lucene doesn't support Kibana's scripted fields):
date_diff > -14400000 and date_diff < -14400000
Alternatively, you could create a filter (via the Add Filter dialog) where date_diff is between -14400000 and 14400000.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.