<?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 show data from TWO different sourcetypes ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-data-from-TWO-different-sourcetypes/m-p/581989#M202728</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237518"&gt;@zacksoft_wf&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;use stats, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=country (sourcetype=sourcetype_A OR sourcetype=sourcetype_B)
| eval ID = ltrim(ID,"0")
| stats 
   count AS dc_st 
   values(age) AS age 
   values(city) AS city 
   values(state) AS state 
   values(job) As job 
   values(salary) AS salary 
   values(gender) AS gender
   By ID
| where dc_st &amp;gt;1&lt;/LI-CODE&gt;&lt;P&gt;if you have a multivalue field, you can expand it adding at the end:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mvexpand &amp;lt;field&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jan 2022 13:11:32 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-01-21T13:11:32Z</dc:date>
    <item>
      <title>How to show data from TWO different sourcetypes ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-data-from-TWO-different-sourcetypes/m-p/581985#M202726</link>
      <description>&lt;P&gt;I have,&lt;BR /&gt;sourcetype_A&amp;nbsp; (fields : ID, age, city, state)&lt;BR /&gt;sourcetype_B&amp;nbsp; (fields : ID, job, salary, gender)&lt;BR /&gt;&lt;BR /&gt;The fields "ID" is common in both sourcetype_A and B but with a caveat.&lt;BR /&gt;example1 : for ID = 1687, it is present in sourcetype_A as 0001687 , in sourcetype_B as 1687&lt;BR /&gt;example2 : for ID = 9843, it is present in sourcetype_A as 009843 , in sourcetype_B as 9843&lt;BR /&gt;example3 : for ID = 8765, it is present in sourcetype_A as 08765 , in sourcetype_B as 8765&lt;BR /&gt;where 1687, 9843, 8765 are the actual IDs. zeros are creating mess in sourcetype_A .&lt;BR /&gt;&lt;BR /&gt;I am not allowed to use join, So this is what I am trying but I am not seeing all my data.&lt;BR /&gt;&lt;BR /&gt;===================================&lt;BR /&gt;(index=country) sourcetype=sourcetype_A OR&amp;nbsp;sourcetype=sourcetype_B&lt;BR /&gt;| eval ID = ltrim(ID,"0")&lt;BR /&gt;| eventstats dc(sourcetype) as dc_st&lt;BR /&gt;| where dc_st &amp;gt;1&lt;BR /&gt;| table&amp;nbsp;ID, age, city, state,&amp;nbsp; job, salary, gender&lt;BR /&gt;===================================&lt;BR /&gt;&lt;BR /&gt;I also tried | stats values (age) as age&amp;nbsp;&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; ........&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;..........................................................&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; by ID.&lt;BR /&gt;But stats gave me massive multivalue fields with messy duplicates. I am asked to get in one row per data (no multivalues )&lt;BR /&gt;&lt;BR /&gt;Any help ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 11:44:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-data-from-TWO-different-sourcetypes/m-p/581985#M202726</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2022-01-21T11:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to show data from TWO different sourcetypes ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-data-from-TWO-different-sourcetypes/m-p/581989#M202728</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237518"&gt;@zacksoft_wf&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;use stats, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=country (sourcetype=sourcetype_A OR sourcetype=sourcetype_B)
| eval ID = ltrim(ID,"0")
| stats 
   count AS dc_st 
   values(age) AS age 
   values(city) AS city 
   values(state) AS state 
   values(job) As job 
   values(salary) AS salary 
   values(gender) AS gender
   By ID
| where dc_st &amp;gt;1&lt;/LI-CODE&gt;&lt;P&gt;if you have a multivalue field, you can expand it adding at the end:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mvexpand &amp;lt;field&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 13:11:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-data-from-TWO-different-sourcetypes/m-p/581989#M202728</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-21T13:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to show data from TWO different sourcetypes ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-data-from-TWO-different-sourcetypes/m-p/582014#M202737</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237518"&gt;@zacksoft_wf&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 15:03:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-data-from-TWO-different-sourcetypes/m-p/582014#M202737</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-01-21T15:03:23Z</dc:date>
    </item>
  </channel>
</rss>

