<?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: How to separate sets of information with same field values without using transaction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-sets-of-information-with-same-field-values/m-p/556745#M158127</link>
    <description>&lt;P&gt;Thank you for the response&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;. What you posted works for the limited data I provided. I'm sorry, I should have included more events with some different scenarios because it isn't working for some other situations. How would you rewrite it to work with a data set like this (a bit altered, so now there is an "Automatic" message that lets us know if the fix was successful or not)?&lt;/P&gt;&lt;P&gt;2021-06-21 16:36:14 Error Fix Success for issue submitted by user:14&lt;BR /&gt;2021-06-21 16:35:22 Error Found for Users:12,13,14&lt;BR /&gt;2021-06-21 16:22:35 Error Fix Automatic Success for issue submitted by user:34&lt;BR /&gt;2021-06-21 16:22:35 Error Fix Success for issue submitted by user:34&lt;BR /&gt;2021-06-21 16:21:11 Error Fix Automatic Success for issue submitted by user:19&lt;BR /&gt;2021-06-21 16:21:11 Error Fix Success for issue submitted by user:19&lt;BR /&gt;2021-06-21 16:20:43 Error Found for Users:15,19,22,23&lt;BR /&gt;2021-06-21 16:07:38 Error Fix Automatic Success for issue submitted by user:14&lt;BR /&gt;2021-06-21 16:07:38 Error Fix Success for issue submitted by user:14&lt;BR /&gt;2021-06-21 16:05:51 Error Found for Users:34,1,18&lt;BR /&gt;2021-06-21 16:04:38 Error Fix Automatic Failure&lt;BR /&gt;2021-06-21 16:04:38 Error Fix Success for issue submitted by user:14&lt;BR /&gt;2021-06-21 16:04:11 Error Found for Users:12,13,14&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the set of data ends in an "Automatic Failure" and the next instance with the same user is not a "Found" message, then the duration should continue. For instance, in the above, the earliest instance for users 12, 13 and 14 starts at 16:04:11 and there is a "Failure" at 16:04:38, but then another "Error Fix Success" message for user 14 occurs but it isn't following a "Found" message, so the duration for these events should be from 16:04:11 to 16:07:38.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jun 2021 17:11:34 GMT</pubDate>
    <dc:creator>Traer001</dc:creator>
    <dc:date>2021-06-22T17:11:34Z</dc:date>
    <item>
      <title>How to separate sets of information with same field values without using transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-sets-of-information-with-same-field-values/m-p/556588#M158075</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have log entries that look like this:&lt;/P&gt;&lt;P&gt;2021-06-21 16:36:14 Error Fix Success for issue submitted by user:14&lt;BR /&gt;2021-06-21 16:35:22 Error Found for Users:12,13,14&lt;BR /&gt;2021-06-21 16:21:11 Error Fix Success for issue submitted by user:19&lt;BR /&gt;2021-06-21 16:20:43 Error Found for Users:15,19,22,23&lt;BR /&gt;2021-06-21 16:07:38 Error Fix Success for issue submitted by user:14&lt;BR /&gt;2021-06-21 16:05:51 Error Found for Users:12,13,14&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to get the details (users, submitted_by user, and times) and calculate the durations of errors from when they are found to when they are fixed. I am trying to do this without using transactions. Currently my search finds the duration from 16:05:51 to 16:36:14 because the two sets of events have the same information. How can I rewrite my query (below) to get two different results for the error affecting users 12, 13 and 14?&lt;/P&gt;&lt;P&gt;My query:&lt;/P&gt;&lt;P&gt;index=INDEX host=HOST sourcetype=SOURCETYPE&lt;BR /&gt;| rex field=_raw "Error\sFound\sfor\sUsers:(?&amp;lt;users&amp;gt;.+)"&lt;BR /&gt;| rex field=_raw "Error\sFix\sSuccess\sfor\sissue\ssubmitted\sby\suser:(?&amp;lt;submitted_by_user&amp;gt;\d+)"&lt;BR /&gt;| where isnotnull(users) or isnotnull(submitted_by_user)&lt;BR /&gt;| sort 0 +_time -users&lt;BR /&gt;| filldown submitted_by_user users&lt;BR /&gt;| sort 0 -_time +users&lt;BR /&gt;| stats earliest(_raw) as earliest_raw latest(_raw) as latest_raw earliest(_time) as early_time latest(_time) as late_time by users submitted_by_user&lt;BR /&gt;| eval submitted_by_user=if(like(latest_raw, "%Found%"), "---", submitted_by_user)&lt;BR /&gt;| eval error_start=strftime(early_time, "%Y-%m-%d %H:%M:%S")&lt;BR /&gt;| eval error_end=if(submitted_by_user != "---", strftime(late_time, "%Y-%m-%d %H:%M:%S"), "---")&lt;BR /&gt;| eval duration=if(submitted_by_user != "---", tostring(late_time-early_time, "duration"), "---")&lt;BR /&gt;| eval users_involved=split(users, ",")&lt;BR /&gt;| eventstats count(users_involved) as user_count by earliest_raw&lt;BR /&gt;| fields - early_time late_time&lt;BR /&gt;| table users_involved, user_count, submitted_by_user, error_start, error_end, duration&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 21:49:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-sets-of-information-with-same-field-values/m-p/556588#M158075</guid>
      <dc:creator>Traer001</dc:creator>
      <dc:date>2021-06-21T21:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate sets of information with same field values without using transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-sets-of-information-with-same-field-values/m-p/556591#M158076</link>
      <description>&lt;P&gt;Will something like this work (it is a little tricky with such a limited data set).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=INDEX host=HOST sourcetype=SOURCETYPE
| rex field=_raw "Error\sFound\sfor\sUsers:(?&amp;lt;users&amp;gt;.+)"
| rex field=_raw "Error\sFix\sSuccess\sfor\sissue\ssubmitted\sby\suser:(?&amp;lt;submitted_by_user&amp;gt;\d+)"
| where isnotnull(users) or isnotnull(submitted_by_user)
| eval error_end=if(isnull(submitted_by_user),null(),_time)
| eval error_start=if(isnull(users),null(),_time)
| sort 0 -_time
| filldown submitted_by_user error_end
| where isnotnull(error_start)
| eval duration=error_end-error_start
| eval users_involved=split(users, ",")
| eval user_count=mvcount(users_involved)
| table users_involved, user_count, submitted_by_user, error_start, error_end, duration&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Jun 2021 23:18:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-sets-of-information-with-same-field-values/m-p/556591#M158076</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-21T23:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate sets of information with same field values without using transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-sets-of-information-with-same-field-values/m-p/556745#M158127</link>
      <description>&lt;P&gt;Thank you for the response&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;. What you posted works for the limited data I provided. I'm sorry, I should have included more events with some different scenarios because it isn't working for some other situations. How would you rewrite it to work with a data set like this (a bit altered, so now there is an "Automatic" message that lets us know if the fix was successful or not)?&lt;/P&gt;&lt;P&gt;2021-06-21 16:36:14 Error Fix Success for issue submitted by user:14&lt;BR /&gt;2021-06-21 16:35:22 Error Found for Users:12,13,14&lt;BR /&gt;2021-06-21 16:22:35 Error Fix Automatic Success for issue submitted by user:34&lt;BR /&gt;2021-06-21 16:22:35 Error Fix Success for issue submitted by user:34&lt;BR /&gt;2021-06-21 16:21:11 Error Fix Automatic Success for issue submitted by user:19&lt;BR /&gt;2021-06-21 16:21:11 Error Fix Success for issue submitted by user:19&lt;BR /&gt;2021-06-21 16:20:43 Error Found for Users:15,19,22,23&lt;BR /&gt;2021-06-21 16:07:38 Error Fix Automatic Success for issue submitted by user:14&lt;BR /&gt;2021-06-21 16:07:38 Error Fix Success for issue submitted by user:14&lt;BR /&gt;2021-06-21 16:05:51 Error Found for Users:34,1,18&lt;BR /&gt;2021-06-21 16:04:38 Error Fix Automatic Failure&lt;BR /&gt;2021-06-21 16:04:38 Error Fix Success for issue submitted by user:14&lt;BR /&gt;2021-06-21 16:04:11 Error Found for Users:12,13,14&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the set of data ends in an "Automatic Failure" and the next instance with the same user is not a "Found" message, then the duration should continue. For instance, in the above, the earliest instance for users 12, 13 and 14 starts at 16:04:11 and there is a "Failure" at 16:04:38, but then another "Error Fix Success" message for user 14 occurs but it isn't following a "Found" message, so the duration for these events should be from 16:04:11 to 16:07:38.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 17:11:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-sets-of-information-with-same-field-values/m-p/556745#M158127</guid>
      <dc:creator>Traer001</dc:creator>
      <dc:date>2021-06-22T17:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate sets of information with same field values without using transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-sets-of-information-with-same-field-values/m-p/556763#M158132</link>
      <description>&lt;P&gt;Assuming that the error isn't actually fixed until the Automatic Success message, try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="2021-06-21 16:36:14 Error Fix Success for issue submitted by user:14
2021-06-21 16:35:22 Error Found for Users:12,13,14
2021-06-21 16:22:35 Error Fix Automatic Success for issue submitted by user:34
2021-06-21 16:22:35 Error Fix Success for issue submitted by user:34
2021-06-21 16:21:11 Error Fix Automatic Success for issue submitted by user:19
2021-06-21 16:21:11 Error Fix Success for issue submitted by user:19
2021-06-21 16:20:43 Error Found for Users:15,19,22,23
2021-06-21 16:07:38 Error Fix Automatic Success for issue submitted by user:14
2021-06-21 16:07:38 Error Fix Success for issue submitted by user:14
2021-06-21 16:05:51 Error Found for Users:34,1,18
2021-06-21 16:04:38 Error Fix Automatic Failure
2021-06-21 16:04:38 Error Fix Success for issue submitted by user:14
2021-06-21 16:04:11 Error Found for Users:12,13,14"
| multikv noheader=t
| fields _raw
| eval _time=strptime(_raw,"%Y-%m-%d %H:%M:%S")
| rex field=_raw "Error\sFound\sfor\sUsers:(?&amp;lt;users&amp;gt;.+)"
| rex field=_raw "Error\sFix\sAutomatic\sSuccess\sfor\sissue\ssubmitted\sby\suser:(?&amp;lt;submitted_by_user&amp;gt;\d+)"
| where isnotnull(users) or isnotnull(submitted_by_user)
| eval error_end=if(isnull(submitted_by_user),null(),_time)
| eval error_start=if(isnull(users),null(),_time)
| sort 0 _time
| eval user=split(users,",")
| mvexpand user
| eval user=coalesce(submitted_by_user,user)
| streamstats latest(error_start) as error_start latest(users) as users by user
| fieldformat error_end=strftime(error_end,"%Y-%m-%d %H:%M:%S")
| fieldformat error_start=strftime(error_start,"%Y-%m-%d %H:%M:%S")
| where isnotnull(error_end)
| eval duration=error_end-error_start
| eval users_involved=split(users, ",")
| eval user_count=mvcount(users_involved)
| table users_involved, user_count, submitted_by_user, error_start, error_end, duration&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 22 Jun 2021 18:49:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-sets-of-information-with-same-field-values/m-p/556763#M158132</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-22T18:49:45Z</dc:date>
    </item>
  </channel>
</rss>

