<?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 combien two search results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631596#M219415</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="nexthink" sourcetype="st_nexthink_device" 
| spath "asset.last_boot_duration" output=boot | spath "asset.last_logon_duration" output=logon | spath "asset.name" output=PC | eval demarrage=boot+logon |eval date=strftime(now(),"%d/%m/%Y") |eval annee_now=mvindex(split(date,"/"),-1) | fields demarrage, PC
| append
[ |search index=easyvista sourcetype=st_easyvista_generic "Identifiant réseau"="PCW-*" Catégorie="Borne tactile" OR Catégorie="All in One" OR Catégorie="Convertible" OR Catégorie="Odinateurs de bureau" OR Catégorie="Ordinateurs portables" OR Catégorie="Ordinateurs format micro" OR Catégorie="Workstation"
| rename "Identifiant réseau" as PC "Date d'installation" as dd | eval annee=mvindex(split(dd,"/"),-1) | eval date=strftime(now(),"%d/%m/%Y") | eval annee_now=mvindex(split(date,"/"),-1) | eval difference=annee_now-annee |fields difference, PC ] | table difference PC demarrage&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 20 Feb 2023 15:35:44 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-02-20T15:35:44Z</dc:date>
    <item>
      <title>How to combine two search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631583#M219414</link>
      <description>&lt;P&gt;Hello &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I need your help for a subject.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to combine two search results and I need you help beacause I have a problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried this :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;index="nexthink" sourcetype="st_nexthink_device" | append&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;[| spath "asset.last_boot_duration" output=boot | spath "asset.last_logon_duration" output=logon | spath "asset.name" output=PC | eval &lt;STRONG&gt;&lt;U&gt;demarrage&lt;/U&gt;&lt;/STRONG&gt;=boot+logon |eval date=strftime(now(),"%d/%m/%Y") |eval annee_now=mvindex(split(date,"/"),-1) | fields demarrage, PC] &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;[ |search index=easyvista sourcetype=st_easyvista_generic "Identifiant réseau"="PCW-*" Catégorie="Borne tactile" OR Catégorie="All in One" OR Catégorie="Convertible" OR Catégorie="Odinateurs de bureau" OR Catégorie="Ordinateurs portables" OR Catégorie="Ordinateurs format micro" OR Catégorie="Workstation" &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;| rename "Identifiant réseau" as PC "Date d'installation" as dd | eval &lt;U&gt;annee&lt;/U&gt;=mvindex(split(dd,"/"),-1) | eval date=strftime(now(),"%d/%m/%Y") | eval annee_now=mvindex(split(date,"/"),-1) | eval difference=annee_now-annee |fields difference, PC ]&lt;/FONT&gt; | table&lt;STRONG&gt; difference&lt;/STRONG&gt; &lt;STRONG&gt;PC demarrage&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;But I have a problem with the "demarrage" field.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anissabnk_0-1676900378390.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23955i9021878BD6EED4B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anissabnk_0-1676900378390.png" alt="anissabnk_0-1676900378390.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I can't get it by combining the two searches.&lt;/P&gt;
&lt;P&gt;I want to mention that I need :&lt;/P&gt;
&lt;P&gt;-&amp;gt; in :&amp;nbsp;&lt;STRONG&gt;index="nexthink" sourcetype="st_nexthink_device" :&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;-----&amp;gt;&amp;nbsp;asset.last_boot_duration&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;-----&amp;gt; asset.last_logon_duration&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;-----&amp;gt; demarrage = BOOT +LOGON&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;-&amp;gt; in :&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;&lt;FONT color="#000000"&gt; index=easyvista sourcetype=st_easyvista_generic&lt;/FONT&gt; &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;-----&amp;gt;&amp;nbsp;date : this year&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;-----&amp;gt; &lt;FONT color="#FF6600"&gt;&lt;FONT color="#000000"&gt;annee : the year of the installation of the PC&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;-----&amp;gt; demarrage = BOOT +LOGON&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 15:17:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631583#M219414</guid>
      <dc:creator>anissabnk</dc:creator>
      <dc:date>2023-02-21T15:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to combien two search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631596#M219415</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="nexthink" sourcetype="st_nexthink_device" 
| spath "asset.last_boot_duration" output=boot | spath "asset.last_logon_duration" output=logon | spath "asset.name" output=PC | eval demarrage=boot+logon |eval date=strftime(now(),"%d/%m/%Y") |eval annee_now=mvindex(split(date,"/"),-1) | fields demarrage, PC
| append
[ |search index=easyvista sourcetype=st_easyvista_generic "Identifiant réseau"="PCW-*" Catégorie="Borne tactile" OR Catégorie="All in One" OR Catégorie="Convertible" OR Catégorie="Odinateurs de bureau" OR Catégorie="Ordinateurs portables" OR Catégorie="Ordinateurs format micro" OR Catégorie="Workstation"
| rename "Identifiant réseau" as PC "Date d'installation" as dd | eval annee=mvindex(split(dd,"/"),-1) | eval date=strftime(now(),"%d/%m/%Y") | eval annee_now=mvindex(split(date,"/"),-1) | eval difference=annee_now-annee |fields difference, PC ] | table difference PC demarrage&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 20 Feb 2023 15:35:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631596#M219415</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-20T15:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to combien two search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631603#M219416</link>
      <description>&lt;P&gt;Unfortunately, it doesn't work :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anissabnk_0-1676908692788.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23958iF63D775E3EBDC62D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anissabnk_0-1676908692788.png" alt="anissabnk_0-1676908692788.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 15:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631603#M219416</guid>
      <dc:creator>anissabnk</dc:creator>
      <dc:date>2023-02-20T15:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to combien two search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631610#M219417</link>
      <description>&lt;P&gt;Can you share some of your events (particularly from the first search) in a code block &amp;lt;/&amp;gt; so that the formatting doesn't hide some of the characters?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 16:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631610#M219417</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-20T16:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to combien two search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631613#M219418</link>
      <description>&lt;P&gt;The syntax of the event of the search is similar to this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{"date": 1676910383.7157812, "asset": {"name": "PCW-TOU-74141", "score:Device performance/Boot speed": 0.0, "total_ram": 8589934592, "total_nonsystem_drive_usage": null, "total_nonsystem_drive_capacity": 0, "system_drive_usage": 0.26, "system_drive_capacity": 494586032128, "platform": "windows", "os_version_and_architecture": "Windows 10 Pro 21H2 (64 bits)", "number_of_days_since_last_boot": 28, "number_of_days_since_last_logon": 0, "number_of_monitors": 1, "cpu_model": "Intel Core i3-7100 CPU @ 3.90GHz", "device_type": "desktop", "distinguished_name": "/DC=org/DC=tpmed/DC=si/OU=VDTOULON/OU=postes/CN=PCW-TOU-74141", "entity": "Noral", "last_system_boot": "2023-02-20T09:55:07", "last_boot_duration": 17795, "last_ip_address": "10.150.115.2", "last_logon_duration": 20000, "last_logon_time": "2023-02-20T10:07:31", "mac_addresses": ["50:9A:4C:48:DE:3B"]}}&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 16:49:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631613#M219418</guid>
      <dc:creator>anissabnk</dc:creator>
      <dc:date>2023-02-20T16:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to combien two search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631615#M219419</link>
      <description>&lt;P&gt;-&amp;gt; For index="nexthink" sourcetype="st_nexthink_device"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{"date": 1676910383.7157812, "asset": {"name": "PCW-TOU-74141", "score:Device performance/Boot speed": 0.0, "total_ram": 8589934592, "total_nonsystem_drive_usage": null, "total_nonsystem_drive_capacity": 0, "system_drive_usage": 0.26, "system_drive_capacity": 494586032128, "platform": "windows", "os_version_and_architecture": "Windows 10 Pro 21H2 (64 bits)", "number_of_days_since_last_boot": 28, "number_of_days_since_last_logon": 0, "number_of_monitors": 1, "cpu_model": "Intel Core i3-7100 CPU @ 3.90GHz", "device_type": "desktop", "distinguished_name": "/DC=org/DC=tpmed/DC=si/OU=VDTOULON/OU=postes/CN=PCW-TOU-74141", "entity": "Noral", "last_system_boot": "2023-02-20T09:55:07", "last_boot_duration": 17795, "last_ip_address": "10.150.115.2", "last_logon_duration": 20000, "last_logon_time": "2023-02-20T10:07:31", "mac_addresses": ["50:9A:4C:48:DE:3B"]}}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt; For index=easyvista sourcetype=st_easyvista_generic&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{"date": 1676911288.1942825, "Date de r\u00e9solution": "20/02/2023 10:58:27", "D\u00e9lai de r\u00e9solution (hh:mm)": " 0:35", "D\u00e9lai de r\u00e9solution (min)": "35", "Enregistr\u00e9 le": "20/02/2023 10:23:39", "Entit\u00e9 (compl\u00e8te)": "Toulon/Direction Generale des Services/Direction Police Municipale", "Groupe responsable": "Centre de service", "N\u00b0 de demande": "S230220_007", "Origine de la demande": "Self Service", "Priorit\u00e9": "2", "Statut de la demande": "Cl\u00f4tur\u00e9"}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The field &lt;U&gt;&lt;STRONG&gt;&lt;FONT color="#800080"&gt;annee &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;: is an extract from this field corresponding to the year of the date , so, annee for this example : &lt;STRONG&gt;annee=2018&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="anissabnk_0-1676912018052.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23960i3F217031B996F651/image-size/medium?v=v2&amp;amp;px=400" role="button" title="anissabnk_0-1676912018052.png" alt="anissabnk_0-1676912018052.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It refers to this part of the previous query :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN&gt;| rename "Identifiant réseau" as PC "Date d'installation" as dd | eval &lt;/SPAN&gt;&lt;U&gt;annee&lt;/U&gt;&lt;SPAN&gt;=mvindex(split(dd,"/"),-1) | eval date=strftime(now(),"%d/%m/%Y")&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 16:57:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631615#M219419</guid>
      <dc:creator>anissabnk</dc:creator>
      <dc:date>2023-02-20T16:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to combien two search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631723#M219420</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 13:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631723#M219420</guid>
      <dc:creator>anissabnk</dc:creator>
      <dc:date>2023-02-21T13:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to combien two search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631735#M219423</link>
      <description>&lt;P&gt;Your second events don't appear to have fields&amp;nbsp;"Identifiant réseau" or "Date d'installation". Having said that, are you trying to "join" events from the first search with event from the second search by PC?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="nexthink" sourcetype="st_nexthink_device" 
| spath "asset.last_boot_duration" output=boot | spath "asset.last_logon_duration" output=logon | spath "asset.name" output=PC | eval demarrage=boot+logon |eval date=strftime(now(),"%d/%m/%Y") |eval annee_now=mvindex(split(date,"/"),-1) | fields demarrage, PC
| append
[ |search index=easyvista sourcetype=st_easyvista_generic "Identifiant réseau"="PCW-*" Catégorie="Borne tactile" OR Catégorie="All in One" OR Catégorie="Convertible" OR Catégorie="Odinateurs de bureau" OR Catégorie="Ordinateurs portables" OR Catégorie="Ordinateurs format micro" OR Catégorie="Workstation"
| rename "Identifiant réseau" as PC "Date d'installation" as dd | eval annee=mvindex(split(dd,"/"),-1) | eval date=strftime(now(),"%d/%m/%Y") | eval annee_now=mvindex(split(date,"/"),-1) | eval difference=annee_now-annee |fields difference, PC ] | stats values(difference) as difference values(demarrage) as demarrage by PC&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 21 Feb 2023 15:50:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-search-results/m-p/631735#M219423</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-21T15:50:44Z</dc:date>
    </item>
  </channel>
</rss>

