<?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 and appendcols returns results, but not giving the desired results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546083#M154775</link>
    <description>&lt;P&gt;To debug the appended search, run it by itself starting with just the inputlookup command.&amp;nbsp; Then run it again with one more command added.&amp;nbsp; Verify the results are as expected after each run.&amp;nbsp; When the results change the cause is the command just added.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 20:59:53 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-03-30T20:59:53Z</dc:date>
    <item>
      <title>Join and appendcols returns results, but not giving the desired results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546036#M154765</link>
      <description>&lt;P&gt;I have a CSV and a Keystore with data that I would like to join together.&amp;nbsp; I read the documentation:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.1.2101/SearchReference/Append" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.1.2101/SearchReference/Append&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.1.2101/SearchReference/Join" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.1.2101/SearchReference/Join&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It appears my type of search might not be covered by either join or append.&amp;nbsp; I have a scan.csv that has about 19,000 IP's with scan data in it and another CSV called IP's.csv that has about 40,000 IP's.&amp;nbsp; The IP's.csv has some systems that have a system name and some that do not.&lt;BR /&gt;&lt;BR /&gt;Shortened example below:&lt;BR /&gt;&lt;BR /&gt;IP's.csv&lt;BR /&gt;&lt;BR /&gt;System&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.1.1&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;BR /&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.1.2&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;BR /&gt;DEF&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;192.168.1.3&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;BR /&gt;DEF&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;192.168.1.4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;DEF&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;192.168.1.5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Scan.csv&lt;BR /&gt;&lt;BR /&gt;IP&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;scan-data&lt;BR /&gt;192.168.1.1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&lt;BR /&gt;192.168.1.2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&lt;BR /&gt;192.168.1.3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&lt;BR /&gt;192.168.1.4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&amp;nbsp;&lt;BR /&gt;192.168.1.5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&lt;BR /&gt;192.168.1.6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&lt;BR /&gt;192.168.1.7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&lt;BR /&gt;&lt;BR /&gt;When I do a join with left, outer, or inner, lookup, or and appendcols, etc, it only returns the data that has "system" field.&amp;nbsp; The data will return and look something like this:&lt;BR /&gt;&lt;BR /&gt;System&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scan-data&lt;BR /&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.1.1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.1.2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;DEF&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;192.168.1.3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;DEF&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.1.4&amp;nbsp; &amp;nbsp; &amp;nbsp; yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;DEF&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;192.168.1.5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;However,&amp;nbsp;192.168.1.6&amp;nbsp; &amp;nbsp;and 192.168.1.7 do not return at all (it appears joins and appends only return what is in common, like by the System field), how do I do a search that returns data that does not have a "System"?&lt;BR /&gt;&lt;BR /&gt;I want the data to return to look something like this:&lt;BR /&gt;&lt;BR /&gt;System&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;scan-data&lt;BR /&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.1.1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.1.2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;DEF&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;192.168.1.3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;DEF&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;192.168.1.4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;DEF&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;192.168.1.5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;192.168.1.6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yes&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.1.7&amp;nbsp; &amp;nbsp; &amp;nbsp; yes&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 15:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546036#M154765</guid>
      <dc:creator>UMDTERPS</dc:creator>
      <dc:date>2021-03-30T15:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Join and appendcols returns results, but not giving the desired results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546038#M154766</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup scan.csv
| append [| inputlookup ips.csv ]
| stats values(system) as system values(scanData) as scanData by IP&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 30 Mar 2021 15:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546038#M154766</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-30T15:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Join and appendcols returns results, but not giving the desired results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546039#M154767</link>
      <description>&lt;P&gt;You're right - &lt;FONT face="courier new,courier"&gt;join&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;appendcols&lt;/FONT&gt; are not right for this.&amp;nbsp; You can use &lt;FONT face="courier new,courier"&gt;append&lt;/FONT&gt; or you can let &lt;FONT face="courier new,courier"&gt;inputlookup&lt;/FONT&gt; do the append for you.&amp;nbsp; &amp;nbsp;The key part is to re-group the results using the &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;```Read the first CSV```
| inputlookup IPs.csv
```Append the second CSV to the result set```
| inputlookup append=true Scan.csv
```Group the results by IP address```
| stats values(*) as * by IP&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 15:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546039#M154767</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-03-30T15:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Join and appendcols returns results, but not giving the desired results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546060#M154769</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup scan_data.csv
|append [
                |inputlookup ip_kv_system  
                |where isnotnull(stuff)
                |eval stuff=split(stuff, "|delim|")
                |mvexpand stuff
                |mvexpand data
                |spath input=stuff "IP Addr" output=ip
                |spath input=devices "OS"
                |spath input=data "fqdn"
                |fields ip "OS" "fqdn"
      ]
   &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The append returns results, but breaks if I add anything after the append.&amp;nbsp; I need to do some data normalization after the append because we have a lot of bad data.&amp;nbsp; For example, If I add&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;|fillnull systems value="N/A"&lt;BR /&gt;| where systems != "N/A"&lt;BR /&gt;&lt;BR /&gt;or&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;|rename field as field&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;or&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;|dedup ip systems&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The data that is in the ip_kv_system gets dropped from the search results.&amp;nbsp; How can I run commands after the append?&lt;BR /&gt;&lt;BR /&gt;Side note: The scan_data.csv is 500MB, not sure if that has an impact.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 18:36:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546060#M154769</guid>
      <dc:creator>UMDTERPS</dc:creator>
      <dc:date>2021-03-30T18:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Join and appendcols returns results, but not giving the desired results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546083#M154775</link>
      <description>&lt;P&gt;To debug the appended search, run it by itself starting with just the inputlookup command.&amp;nbsp; Then run it again with one more command added.&amp;nbsp; Verify the results are as expected after each run.&amp;nbsp; When the results change the cause is the command just added.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 20:59:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-and-appendcols-returns-results-but-not-giving-the-desired/m-p/546083#M154775</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-03-30T20:59:53Z</dc:date>
    </item>
  </channel>
</rss>

