<?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: selfjoin several result rows on different fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550814#M156307</link>
    <description>&lt;P&gt;Will it always be groups of 3?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval fld1="A", fld3="B"
| append [makeresults
| eval fld3="B", fld4="C"
]
| append [makeresults
| eval fld2="D", fld4="C"
]
| append [makeresults
| eval fld1="E", fld3="F"
]
| append [makeresults
| eval fld3="F", fld4="G"
]
| append [makeresults
| eval fld2="H", fld4="G"
]
| table fld1 fld2 fld3 fld4
| streamstats count as group
| eval group=floor((group-1)/3)
| stats values(*) as * by group&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 07 May 2021 12:57:56 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-05-07T12:57:56Z</dc:date>
    <item>
      <title>selfjoin several result rows on different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550799#M156303</link>
      <description>&lt;P&gt;I have a search result where each 3&amp;nbsp; follwing lines are a block I want to join to one row like:&lt;/P&gt;&lt;P&gt;fld1 fld2 fld3 fld4&lt;BR /&gt;A&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; B&lt;BR /&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; B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D&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; C&lt;BR /&gt;E&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; F&lt;BR /&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; F&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; G&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; H&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; G&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as a result of the join I want to have:&lt;/P&gt;&lt;P&gt;fld1 fld2 fld3 fld4&lt;BR /&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D &amp;nbsp; &amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;BR /&gt;E&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; H&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; F&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; G&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried with the following search, which works partially:&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval fld1="A", fld3="B"&lt;BR /&gt;| append [makeresults&lt;BR /&gt;| eval fld3="B", fld4="C"&lt;BR /&gt;]&lt;BR /&gt;| append [makeresults&lt;BR /&gt;| eval fld2="D", fld4="C"&lt;BR /&gt;]&lt;BR /&gt;| append [makeresults&lt;BR /&gt;| eval fld1="E", fld3="F"&lt;BR /&gt;]&lt;BR /&gt;| append [makeresults&lt;BR /&gt;| eval fld3="F", fld4="G"&lt;BR /&gt;]&lt;BR /&gt;| append [makeresults&lt;BR /&gt;| eval fld2="H", fld4="G"&lt;BR /&gt;]&lt;BR /&gt;| table fld1 fld2 fld3 fld4&lt;BR /&gt;| outputcsv fldRows&lt;BR /&gt;| fields - *&lt;BR /&gt;| append [&lt;BR /&gt;| inputcsv fldRows&lt;BR /&gt;| selfjoin fld3&lt;BR /&gt;]&lt;BR /&gt;| append [&lt;BR /&gt;| inputcsv fldRows&lt;BR /&gt;| selfjoin fld4&lt;BR /&gt;]&lt;BR /&gt;| selfjoin fld4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two probems:&lt;/P&gt;&lt;P&gt;when running for the first time there is no result.&lt;/P&gt;&lt;P&gt;When modifying a field the first value of this field is returned&lt;/P&gt;&lt;P&gt;There seems to be a problem that on th second and followng run outputcsv does not update fldRows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also curious if there is a simpler approach for getting the desired results&lt;/P&gt;&lt;P&gt;Thanks for a response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 12:07:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550799#M156303</guid>
      <dc:creator>wiar</dc:creator>
      <dc:date>2021-05-07T12:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: selfjoin several result rows on different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550814#M156307</link>
      <description>&lt;P&gt;Will it always be groups of 3?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval fld1="A", fld3="B"
| append [makeresults
| eval fld3="B", fld4="C"
]
| append [makeresults
| eval fld2="D", fld4="C"
]
| append [makeresults
| eval fld1="E", fld3="F"
]
| append [makeresults
| eval fld3="F", fld4="G"
]
| append [makeresults
| eval fld2="H", fld4="G"
]
| table fld1 fld2 fld3 fld4
| streamstats count as group
| eval group=floor((group-1)/3)
| stats values(*) as * by group&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 May 2021 12:57:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550814#M156307</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-07T12:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: selfjoin several result rows on different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550819#M156310</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;: yes there are always 3 rows and thanks for your solution, that is exactly what I was searching for&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 13:05:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550819#M156310</guid>
      <dc:creator>wiar</dc:creator>
      <dc:date>2021-05-07T13:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: selfjoin several result rows on different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550826#M156311</link>
      <description>&lt;P&gt;A side question: what is the reason for the outputcsv file to not always be updated?&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 13:32:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550826#M156311</guid>
      <dc:creator>wiar</dc:creator>
      <dc:date>2021-05-07T13:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: selfjoin several result rows on different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550831#M156312</link>
      <description>&lt;P&gt;No idea - my guess would be something to do with caching or sharing resources - are you running with a cluster?&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 13:39:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/selfjoin-several-result-rows-on-different-fields/m-p/550831#M156312</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-07T13:39:25Z</dc:date>
    </item>
  </channel>
</rss>

