<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Join two indexes on time where time is different by 2 sec in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703527#M238435</link>
    <description>&lt;P&gt;Join on _time doesn't make sense if the time is off in one of data sets. You noticed it yourself.&lt;/P&gt;&lt;P&gt;This transaction doesn't make sense either since you don't have a field called &lt;EM&gt;src&lt;/EM&gt; which could contain one of those strings.&lt;/P&gt;&lt;P&gt;If this is indeed &lt;EM&gt;all&lt;/EM&gt; the data you have it's a very tricky problem in general. Because what if the same user requests two print jobs within a second? How can you tell which one went to which printer if the only common field is the username?&lt;/P&gt;&lt;P&gt;If you can make some assumptions about the data the problem can be solved one way or another. You can use transaction on username field and indeed maxspan=3s or something like that (maybe add a startswith="index=printserver" endswith="index=printlogs". But transaction is a relatively resource-intensive command and is best avoided if possible. So if you can make some other assumptions maybe the solution could be better.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Nov 2024 21:06:03 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-11-04T21:06:03Z</dc:date>
    <item>
      <title>Join two indexes on time where time is different by 2 sec</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703523#M238434</link>
      <description>&lt;DIV&gt;Hello, I am trying to join two indexes to display data from our local printers.&amp;nbsp; I have an index getting data from our printer server that contains the following data:&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;index=prntserver&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;U&gt;_time&lt;/U&gt;,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;U&gt;prnt_name&lt;/U&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;U&gt;username&amp;nbsp;&lt;/U&gt; &amp;nbsp;&lt;U&gt;location&lt;/U&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2024-11-04 11:05:32&amp;nbsp; &amp;nbsp; Printer1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;jon.doe&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Office&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2024-11-04 12:20:56&amp;nbsp; &amp;nbsp; Printer2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tim.allen&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FrontDesk&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have an index getting data from our DLP software that contains the following data:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;STRONG&gt; &amp;nbsp;index=printlogs&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;U&gt;_time&lt;/U&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; usersname&amp;nbsp; &amp;nbsp; &amp;nbsp;directory&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2024-11-04 11:05:33&amp;nbsp; &amp;nbsp; jon.doe&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c:/desktop/prints/&amp;nbsp; &amp;nbsp; &amp;nbsp;document1.doc&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2024-11-04 12:20:58&amp;nbsp; &amp;nbsp; tim.allen&amp;nbsp; c:/documents/files/&amp;nbsp; &amp;nbsp;document2.xlsx&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am trying to join the two indexes to give me time, printer name, user name and location from the &lt;STRONG&gt;Print Server Index&lt;/STRONG&gt; and then give me directory and file name that was recorded from my &lt;STRONG&gt;Print Log Index&lt;/STRONG&gt;.&amp;nbsp; I am wanting to use time to join the two indexes but my issues is that the timestamp is off by 1 if not 2 seconds between the two index records.&amp;nbsp; I was trying to use the transaction command with a maxspan=3s to be safe but cannot get it to work.&amp;nbsp; Here is what I have been trying to work with&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;index=printserver&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;| convert timeformat="%Y-%m-%d %H:%M:%S" ctime(_time) AS servtime&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp;| join type=inner _time&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; [ search index=printlogs&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | convert timeformat="%Y-%m-%d %H:%M:%S" ctime(_time) AS logtime&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ]&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;| transaction startswith=eval(src="&amp;lt;servtime&amp;gt;") endswith=eval(src="&amp;lt;logtime&amp;gt;") maxspan=3s&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;| table servtime prnt_name username location directory file&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for any assistance given on this one.&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 04 Nov 2024 20:20:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703523#M238434</guid>
      <dc:creator>ramuzzini</dc:creator>
      <dc:date>2024-11-04T20:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Join two indexes on time where time is different by 2 sec</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703527#M238435</link>
      <description>&lt;P&gt;Join on _time doesn't make sense if the time is off in one of data sets. You noticed it yourself.&lt;/P&gt;&lt;P&gt;This transaction doesn't make sense either since you don't have a field called &lt;EM&gt;src&lt;/EM&gt; which could contain one of those strings.&lt;/P&gt;&lt;P&gt;If this is indeed &lt;EM&gt;all&lt;/EM&gt; the data you have it's a very tricky problem in general. Because what if the same user requests two print jobs within a second? How can you tell which one went to which printer if the only common field is the username?&lt;/P&gt;&lt;P&gt;If you can make some assumptions about the data the problem can be solved one way or another. You can use transaction on username field and indeed maxspan=3s or something like that (maybe add a startswith="index=printserver" endswith="index=printlogs". But transaction is a relatively resource-intensive command and is best avoided if possible. So if you can make some other assumptions maybe the solution could be better.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 21:06:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703527#M238435</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-11-04T21:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Join two indexes on time where time is different by 2 sec</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703529#M238437</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;like in most cases a simple 'stats' will do the trick.&lt;/P&gt;&lt;P&gt;Try something like this&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=printserver OR index=printlogs
| bin _time span=3s
| stats values(*) AS * by _time username
| table _time prnt_name username location directory file&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps ...&lt;/P&gt;&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 21:07:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703529#M238437</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2024-11-04T21:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Join two indexes on time where time is different by 2 sec</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703530#M238438</link>
      <description>&lt;P&gt;That was my initial reaction but as usual - binning has issues when your events cross the bin boundary. For example - one event at :11, another at :14. They will be binned into separate buckets and won't match.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 21:08:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703530#M238438</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-11-04T21:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Join two indexes on time where time is different by 2 sec</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703531#M238439</link>
      <description>&lt;P&gt;HaHA, I was answering based on the provided information not trying to work around every single possible outlier &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 21:12:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703531#M238439</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2024-11-04T21:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Join two indexes on time where time is different by 2 sec</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703536#M238443</link>
      <description>&lt;P&gt;Actually it's not that much of an outlier. Assuming 2s split between first and second event you have 2/3 chance of splitting them into two separate bins.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 21:41:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703536#M238443</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-11-04T21:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Join two indexes on time where time is different by 2 sec</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703602#M238468</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;MuS,&lt;BR /&gt;&lt;BR /&gt;Thanks for the response.&amp;nbsp; I am going to take this and work with what I have.&amp;nbsp; As I put this in my search, found out that my test data is different then what my _raw data actually is.&amp;nbsp; The username field from&amp;nbsp; printserver index is "username" but my username field from my printlogs is "User_Name" but has a domain name is front of it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;index=prntserver&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;U&gt;_time&lt;/U&gt;,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;U&gt;prnt_name&lt;/U&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;U&gt;username&amp;nbsp;&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;U&gt;location&lt;/U&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2024-11-04 11:05:32&amp;nbsp; &amp;nbsp; Printer1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;jon.doe&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Office&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2024-11-04 12:20:56&amp;nbsp; &amp;nbsp; Printer2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tim.allen&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FrontDesk&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have an index getting data from our DLP software that contains the following data:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;index=printlogs&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;U&gt;_time&lt;/U&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Users_Name&amp;nbsp; &amp;nbsp; &amp;nbsp;directory&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2024-11-04 11:05:33&amp;nbsp; &amp;nbsp; cpn/jon.doe&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c:/desktop/prints/&amp;nbsp; &amp;nbsp; &amp;nbsp;document1.doc&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2024-11-04 12:20:58&amp;nbsp; &amp;nbsp; tim.allen&amp;nbsp; c:/documents/files/&amp;nbsp; &amp;nbsp;document2.xlsx&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;I am going ot Rex the User_Name field from my print logs to match it with my printserver logs.&amp;nbsp; This is what I am going to work with and see if I get the results I need.&amp;nbsp; Thank you for your insight.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;index=printserver OR index=printlogs&lt;BR /&gt;| rex field="User_Name" "(?&amp;lt;domain&amp;gt;\S)+\\\\(?&amp;lt;username&amp;gt;\S+)"&lt;BR /&gt;| bin _time span=3s | stats values(*) AS * by _time username&lt;BR /&gt;| table _time prnt_name username location directory file&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 14:25:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703602#M238468</guid>
      <dc:creator>ramuzzini</dc:creator>
      <dc:date>2024-11-05T14:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Join two indexes on time where time is different by 2 sec</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703605#M238469</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Thanks again for giving me your insight on this one.&amp;nbsp; I did come across the bin command but thought the transaction might be better to try in this situation.&amp;nbsp; As I am still learning the power and uses of many of the commands that can be used in Splunk, this does help&amp;nbsp;me get a better understanding of how to use and when to use the transaction command.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you pointed out and is my true problem in this case, there are only two common/semi common variables I have between my two indexes,&amp;nbsp; that being "&lt;STRONG&gt;_time&lt;/STRONG&gt;" and "&lt;STRONG&gt;username&lt;/STRONG&gt;".&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have compared the raw logs from both indexes and it appears that at most, the print jobs are separated by 2 secs and I haven't seen any print jobs by the same user that have been closer than 10 seconds apart.&amp;nbsp; But as to your point, I will make note that there could be some issue with my output if a user prints two jobs seconds apart from each other.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;As always, appreciate your input and clarification on my questions.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 14:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703605#M238469</guid>
      <dc:creator>ramuzzini</dc:creator>
      <dc:date>2024-11-05T14:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Join two indexes on time where time is different by 2 sec</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703756#M238499</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;notes, if time is critical for correlation, bin is risky. &amp;nbsp;This is one of the use cases where transaction is appropriate. &amp;nbsp;But you cannot use span alone. &amp;nbsp;Using index alone with _time is also unsafe. &amp;nbsp;From the context implied in mock data, you want transaction by user. &amp;nbsp;It is very important that you describe these critical logic clearly, explicitly, and without help from SPL.&lt;/P&gt;&lt;P&gt;The only obstacle is the field names "username" and "Users_Name"; this is so easily overcome with&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/ConditionalFunctions#coalesce.28.26lt.3Bvalues.26gt.3B.29" target="_blank" rel="noopener"&gt;coalesce&lt;/A&gt;. (It is never a good idea to illustrate mock data with inaccuracy. &amp;nbsp;If the field name is Users_Name, you should consistently illustrate it as Users_Name and not usersname.) &amp;nbsp;One element that distracted people is the servtime and logtime conversion in initial illustrated SPL. &amp;nbsp;These fields adds no value to the use case.&lt;/P&gt;&lt;P&gt;This is the code that should get you started&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=printserver OR index=printlogs
| eval username = coalesce(username, Users_Name)
| fields - usersname
| transaction username maxspan=3s
| table _time prnt_name username location directory file&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using your corrected mock data, the above gives&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="166.046875px" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="90.765625px" height="25px"&gt;prnt_name&lt;/TD&gt;&lt;TD width="82.890625px" height="25px"&gt;username&lt;/TD&gt;&lt;TD width="85.859375px" height="25px"&gt;location&lt;/TD&gt;&lt;TD width="155.28125px" height="25px"&gt;directory&lt;/TD&gt;&lt;TD width="125.71875px" height="25px"&gt;file&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px" height="25px"&gt;2024-11-04 12:20:56&lt;/TD&gt;&lt;TD width="90.765625px" height="25px"&gt;Printer2&lt;/TD&gt;&lt;TD width="82.890625px" height="25px"&gt;tim.allen&lt;/TD&gt;&lt;TD width="85.859375px" height="25px"&gt;FrontDesk&lt;/TD&gt;&lt;TD width="155.28125px" height="25px"&gt;c:/documents/files/&lt;/TD&gt;&lt;TD width="125.71875px" height="25px"&gt;document2.xlsx&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="166.046875px" height="25px"&gt;2024-11-04 11:05:32&lt;/TD&gt;&lt;TD width="90.765625px" height="25px"&gt;Printer1&lt;/TD&gt;&lt;TD width="82.890625px" height="25px"&gt;jon.doe&lt;/TD&gt;&lt;TD width="85.859375px" height="25px"&gt;Office&lt;/TD&gt;&lt;TD width="155.28125px" height="25px"&gt;c:/desktop/prints/&lt;/TD&gt;&lt;TD width="125.71875px" height="25px"&gt;document1.doc&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Here is an emulation of your mock data. &amp;nbsp;Play with it and compare with real data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="_time,                                   prnt_name,     username,   location, _raw
2024-11-04 11:05:32,    Printer1,           jon.doe,         Office, server event 1
2024-11-04 12:20:56,    Printer2,           tim.allen,       FrontDesk, server event 2"
| eval index = "prntserver"
| append
    [makeresults format=csv data="_time,                                    Users_Name,     directory,                          file, _raw
2024-11-04 11:05:33,    jon.doe,             c:/desktop/prints/,     document1.doc, log event 1
2024-11-04 12:20:58,    tim.allen,  c:/documents/files/,   document2.xlsx, log event 2"
    | eval index = "printlogs"]
| eval _time = strptime(_time, "%F %T")
| sort - _time
``` the above emulates
index=printserver OR index=printlogs
```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 04:37:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-two-indexes-on-time-where-time-is-different-by-2-sec/m-p/703756#M238499</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-11-07T04:37:41Z</dc:date>
    </item>
  </channel>
</rss>

