<?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 How to group two field values into separate fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-two-field-values-into-separate-fields/m-p/448430#M127052</link>
    <description>&lt;P&gt;I am working with data that is shared/backed up by two separate hosts. Each userID is linked to two hosts. When there are data issues (server outages, etc), a certain error on the host is triggered. I need to find out when the error is triggered for BOTH hosts at the same time. The error may be triggered every 5 minutes, so I need a table showing each userID, the two hosts that map to that user, and each timestamp that is within 5 seconds (due to latency timestamp may not match exactly). &lt;/P&gt;

&lt;P&gt;Therefore, I believe I somehow need to separate the two hosts into separate fields, but am not sure the best way to do this. &lt;BR /&gt;
The psuedo code would look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;for each userID{
   if (host1 != host2 &amp;amp;&amp;amp; abs(host1.timestamp-host2.timestamp) &amp;lt;= 5 &amp;amp;&amp;amp; host1.error==host2.error){
         return (userID, host1,  host2, timestamp) 
   }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way in Splunk that I can generate this table by comparing timestamps of the two hosts that are connected to the userID?&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2019 13:31:37 GMT</pubDate>
    <dc:creator>bofasplunkguy</dc:creator>
    <dc:date>2019-06-25T13:31:37Z</dc:date>
    <item>
      <title>How to group two field values into separate fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-two-field-values-into-separate-fields/m-p/448430#M127052</link>
      <description>&lt;P&gt;I am working with data that is shared/backed up by two separate hosts. Each userID is linked to two hosts. When there are data issues (server outages, etc), a certain error on the host is triggered. I need to find out when the error is triggered for BOTH hosts at the same time. The error may be triggered every 5 minutes, so I need a table showing each userID, the two hosts that map to that user, and each timestamp that is within 5 seconds (due to latency timestamp may not match exactly). &lt;/P&gt;

&lt;P&gt;Therefore, I believe I somehow need to separate the two hosts into separate fields, but am not sure the best way to do this. &lt;BR /&gt;
The psuedo code would look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;for each userID{
   if (host1 != host2 &amp;amp;&amp;amp; abs(host1.timestamp-host2.timestamp) &amp;lt;= 5 &amp;amp;&amp;amp; host1.error==host2.error){
         return (userID, host1,  host2, timestamp) 
   }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way in Splunk that I can generate this table by comparing timestamps of the two hosts that are connected to the userID?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:31:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-two-field-values-into-separate-fields/m-p/448430#M127052</guid>
      <dc:creator>bofasplunkguy</dc:creator>
      <dc:date>2019-06-25T13:31:37Z</dc:date>
    </item>
  </channel>
</rss>

