<?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: splunk query to combine 2 tables with multiple values in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/561803#M10162</link>
    <description>&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="name type date Dates
AAA BBB 03-08-2021 01-08-2021,02-08-2021,03-08-2021
AAA CCC 02-08-2021 01-08-2021,02-08-2021,03-08-2021 
XXX BBB 02-08-2021 01-08-2021,02-08-2021,03-08-2021
XXX CCC 04-08-2021 01-08-2021,02-08-2021,03-08-2021"
| multikv fields name type date Dates forceheader=1
| table name type date Dates


| eval found=if(match(Dates,date),"found","not found")&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 03 Aug 2021 08:45:14 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-08-03T08:45:14Z</dc:date>
    <item>
      <title>splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/556919#M10009</link>
      <description>&lt;P&gt;I have a static lookup file which has 2 columns. Example: name, type. Please note this static lookup has no reference to date timestamp. Now am trying to combine to frame this as a table which will append date as another column. I would like to use the resulting table to compare against another result set to confirm that there was an event logged for each type on dailybasis and report only the missing ones.&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;Name | Type | Date&lt;/P&gt;&lt;P&gt;AAA | BBB | 22/06/2021&lt;/P&gt;&lt;P&gt;AAA | BBB | 23/06/2021&lt;/P&gt;&lt;P&gt;AAA | BBB | 24/06/2021&lt;/P&gt;&lt;P&gt;CCC | DDD | 22/06/2021&lt;/P&gt;&lt;P&gt;CCC | DDD | 23/06/2021&lt;/P&gt;&lt;P&gt;CCC | DDD | 24/06/2021&lt;/P&gt;&lt;P&gt;EEE | FFF | 22/06/2021&lt;/P&gt;&lt;P&gt;EEE | FFF | 23/06/2021&lt;/P&gt;&lt;P&gt;EEE | FFF | 24/06/2021&lt;/P&gt;&lt;P&gt;GGG | HHH | 22/06/2021&lt;/P&gt;&lt;P&gt;GGG | HHH | 23/06/2021&lt;/P&gt;&lt;P&gt;GGG | HHH | 24/06/2021&lt;/P&gt;&lt;P&gt;Query I have been trying to use is [inputlookup test.csv | fields Name, Type] appendcols [[| gentimes start=-3 | eval Dates=strftime(starttime,"%Y%m%d") | table Dates]. I have been trying to use multiple commands but with no luck &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; It appends just the first row. since my date table has 3 rows, it will append dates in first 3 rows.&amp;nbsp; Thanks for any help in achieving this!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 02:13:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/556919#M10009</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-06-24T02:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/556929#M10010</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/28050"&gt;@sdkp03&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup test.csv | fields Name Type
| join [| gentimes start=-3 | eval Dates=strftime(starttime,"%Y-%m-%d") | table Dates | stats delim="," values(Dates) As Dates]
| eval Dates=split(Dates,",")
|mvexpand Dates&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="Name | Type
AAA | BBB
CCC | DDD
EEE | FFF
GGG | HHH
"| multikv forceheader=1
| table Name Type
| join [| gentimes start=-3 | eval Dates=strftime(starttime,"%Y-%m-%d") | table Dates | stats delim="," values(Dates) As Dates]
| eval Dates=split(Dates,",")
|mvexpand Dates&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 04:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/556929#M10010</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-24T04:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/561761#M10161</link>
      <description>&lt;P&gt;Thanks for that I now have a table with below&amp;nbsp; columns:&lt;/P&gt;&lt;P&gt;FN | FT | date | Dates&lt;/P&gt;&lt;P&gt;AAA | BBB | 03-08-2021 | 01-08-2021, 02-08-2021,03-08-2021&lt;/P&gt;&lt;P&gt;AAA | CCC | 02-08-2021 |&amp;nbsp;01-08-2021, 02-08-2021,03-08-2021&amp;nbsp;&lt;/P&gt;&lt;P&gt;XXX | BBB | 02-08-2021 |&amp;nbsp;&amp;nbsp;01-08-2021, 02-08-2021,03-08-2021&lt;/P&gt;&lt;P&gt;XXX | CCC | 03-08-2021 |&amp;nbsp;&amp;nbsp;01-08-2021, 02-08-2021,03-08-2021&lt;/P&gt;&lt;P&gt;I am trying to compare date and Dates column and want to print missing dates as output. I tried using join and eventstats count command but somehow am not able to achieve without loosing FT/FN type. Can you please assist with this.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 00:04:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/561761#M10161</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-08-03T00:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/561803#M10162</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="name type date Dates
AAA BBB 03-08-2021 01-08-2021,02-08-2021,03-08-2021
AAA CCC 02-08-2021 01-08-2021,02-08-2021,03-08-2021 
XXX BBB 02-08-2021 01-08-2021,02-08-2021,03-08-2021
XXX CCC 04-08-2021 01-08-2021,02-08-2021,03-08-2021"
| multikv fields name type date Dates forceheader=1
| table name type date Dates


| eval found=if(match(Dates,date),"found","not found")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Aug 2021 08:45:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/561803#M10162</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-03T08:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/561841#M10163</link>
      <description>&lt;P&gt;Apologies didn't mention the expected output result format:&lt;/P&gt;&lt;P&gt;FN&amp;nbsp; &amp;nbsp;|&amp;nbsp; FT&amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; date&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dates&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;Missing dates&lt;BR /&gt;AAA BBB 03-08-2021 01-08-2021,02-08-2021,03-08-2021 01-08-2021,02-08-2021&lt;BR /&gt;AAA CCC 02-08-2021 01-08-2021,02-08-2021,03-08-2021 01-08-2021,03-08-2021&lt;BR /&gt;XXX BBB 02-08-2021 01-08-2021,02-08-2021,03-08-2021 01-08-2021,03-08-2021&lt;BR /&gt;XXX CCC 03-08-2021 01-08-2021,02-08-2021,03-08-2021 01-08-2021,02-08-2021&lt;/P&gt;&lt;P&gt;I am looking in for query to retrieve last column.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 11:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/561841#M10163</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-08-03T11:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/561844#M10164</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval missing_dates=trim(replace(replace(Dates,date,""),",,",","),",")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Aug 2021 11:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/561844#M10164</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-03T11:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562024#M10169</link>
      <description>&lt;P&gt;Its weird it works with one query and doesn't work for different query. Now when I try to use same logic, its purely replacing Dates with date!!!! Can you please explain the logic.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 06:49:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562024#M10169</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-08-04T06:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562030#M10170</link>
      <description>&lt;P&gt;The inner replace() replaces the date in the Dates string with an empty string&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;replace("01-08-2021,02-08-2021,03-08-2021","02-08-2021","") gives&amp;nbsp;"01-08-2021,,03-08-2021".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The next replace() replaces the double comma (,,) with a single comma (,)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;replace("01-08-2021,,03-08-2021",",,",",") gives&amp;nbsp;"01-08-2021,03-08-2021"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the date was&amp;nbsp;03-08-2021&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;replace ("01-08-2021,02-08-2021,03-08-2021","03-08-2021","") gives&amp;nbsp;"01-08-2021,02-08-2021," so the trim() removes trailing (and leading) commas&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 07:16:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562030#M10170</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-04T07:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562031#M10171</link>
      <description>&lt;P&gt;Figured out the reason for inconsistency. Please see below result, when date doesn't follow the sequence replace doesn't work as expected. First row works as expected since date has a pattern, but second row onwards it fails because date has broken sequence as reports were missing on specific dates:&lt;/P&gt;&lt;P&gt;BBBB AAAA 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03&lt;BR /&gt;BBBB AAAA 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03&lt;BR /&gt;BBBB AAAA 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03&lt;BR /&gt;BBBB AAAA 2021-07-29,2021-07-30,2021-08-01,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 07:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562031#M10171</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-08-04T07:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562032#M10172</link>
      <description>&lt;P&gt;I am not sure what you are showing here or what you mean by broken pattern&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 07:31:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562032#M10172</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-04T07:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562033#M10173</link>
      <description>&lt;P&gt;But,&amp;nbsp;replace("01-08-2021,02-08-2021,03-08-2021","01-08-2021,03-08-2021","") prints&amp;nbsp;01-08-2021,02-08-2021,03-08-2021. This is causing the issue in my case. What would you think is the best way to handle this!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 07:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562033#M10173</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-08-04T07:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562034#M10174</link>
      <description>&lt;P&gt;So you are now trying this with multiple dates not the single date you had in the original question?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 07:37:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562034#M10174</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-04T07:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562148#M10177</link>
      <description>&lt;P&gt;Yes that's right. When I did expand the date range, this is the issue I have landed with.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 23:51:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562148#M10177</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-08-04T23:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562194#M10178</link>
      <description>&lt;P&gt;Your example data had spaces in some of the Dates instead of commas so I added a replace to correct that. I am not sure if this is necessary or just a result of copy/paste.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="name type date Dates
BBBB AAAA 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03
BBBB AAAA 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03
BBBB AAAA 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03
BBBB AAAA 2021-07-29,2021-07-30,2021-08-01,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03 2021-07-28,2021-07-29,2021-07-30,2021-07-31,2021-08-01,2021-08-02,2021-08-03"
| multikv fields name type date Dates forceheader=1
| table name type date Dates



| eval Dates=replace(Dates," ",",")
| eval date=replace(date,",","|")
| eval missing_dates=trim(replace(replace(Dates,date,""),",+",","),",")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Aug 2021 07:10:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562194#M10178</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-05T07:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: splunk query to combine 2 tables with multiple values</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562389#M10182</link>
      <description>&lt;P&gt;This worked like charm. Thanks so much for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 08:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/splunk-query-to-combine-2-tables-with-multiple-values/m-p/562389#M10182</guid>
      <dc:creator>sdkp03</dc:creator>
      <dc:date>2021-08-06T08:39:36Z</dc:date>
    </item>
  </channel>
</rss>

