<?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 4 source types with common field after eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496192#M138293</link>
    <description>&lt;P&gt;correct, want to exclude source1 count values &amp;lt;=0&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2020 00:00:40 GMT</pubDate>
    <dc:creator>msrama5</dc:creator>
    <dc:date>2020-05-12T00:00:40Z</dc:date>
    <item>
      <title>Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496182#M138283</link>
      <description>&lt;P&gt;Hello, I have 4 sources (source 1-4) , common field for source 1 to 3 is Properties.Id,  source4 common field is Id, does not have properties., I need to join these 4 sources on field Properties.Id, since source 4 just has Id, I renamed this field to Properties.Id using eval, with eval change, the query below is not working, it is not doing the join correctly using field Properties.Id, any ideas what is the issue here ?&lt;BR /&gt;
Splunk query-&lt;BR /&gt;
sourcetype=source1 OR sourcetype=source2  OR sourcetype=source3  OR sourcetype=source4&lt;BR /&gt;&lt;BR /&gt;
| eval Properties.Id=if(sourcetype="source4",Id,null()) &lt;BR /&gt;
 | stats values(Properties.Id) as Id by sourcetype&lt;BR /&gt;
 |append [|makeresults &lt;BR /&gt;
 |eval sourcetype=split("source1 ,source2 ,source3 ,source4" ,",")&lt;BR /&gt;
 | mvexpand sourcetype&lt;BR /&gt;
 | fields sourcetype]&lt;BR /&gt;
 | fillnull value="Not exists" Id|  chart count over Id by sourcetype&lt;BR /&gt;
 |sort (Id )&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 20:02:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496182#M138283</guid>
      <dc:creator>msrama5</dc:creator>
      <dc:date>2020-05-11T20:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496183#M138284</link>
      <description>&lt;P&gt;It looks like you're overwriting the value of Properties.Id with this command:&lt;/P&gt;

&lt;P&gt;| eval Properties.Id=if(sourcetype="source4",Id,null()) &lt;/P&gt;

&lt;P&gt;Your 3 original sources will now lose their Properties.Id field&lt;BR /&gt;
Take a look at the coalesce eval command &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.3/SearchReference/ConditionalFunctions"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.3/SearchReference/ConditionalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 21:02:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496183#M138284</guid>
      <dc:creator>606866581</dc:creator>
      <dc:date>2020-05-11T21:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496184#M138285</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;sourcetype=source1 OR sourcetype=source2 OR sourcetype=source3 OR sourcetype=source4
| eval Id=coalesce('Properties.Id',Id)
| stats count by Id sourcetype
|append [|makeresults 
|eval sourcetype=split("source1 ,source2 ,source3 ,source4" ,",")
| mvexpand sourcetype
| fields sourcetype]
| xyseries Id sourcetype count
| fillnull source1 ,source2 ,source3 ,source4  value="Not exists" 
| sort Id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2020 21:10:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496184#M138285</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-11T21:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496185#M138286</link>
      <description>&lt;P&gt;I'm not sure what your particular use case is, but to me it seems like this would be a simpler way to create the same table without needing to |append &lt;/P&gt;

&lt;P&gt;sourcetype=source1 OR sourcetype=source2 OR sourcetype=source3 OR sourcetype=source4&lt;BR /&gt;
| eval Id=coalesce('Properties.Id',Id)&lt;BR /&gt;
| stats count by Id sourcetype&lt;BR /&gt;
| xyseries Id sourcetype count&lt;BR /&gt;
| fillnull source1 source2 source3 source4 value="Not exists" &lt;BR /&gt;
| sort Id&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 21:29:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496185#M138286</guid>
      <dc:creator>606866581</dc:creator>
      <dc:date>2020-05-11T21:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496186#M138287</link>
      <description>&lt;P&gt;&lt;CODE&gt;append&lt;/CODE&gt; is need when some sourcetype is missing.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 21:34:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496186#M138287</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-11T21:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496187#M138288</link>
      <description>&lt;P&gt;thanks, it works, I need to add one more filter condition for values count in source1 sourcetype &amp;gt; 0 and only show those values , where to apply filter for source1 values count &amp;gt; 0 ? &lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 23:09:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496187#M138288</guid>
      <dc:creator>msrama5</dc:creator>
      <dc:date>2020-05-11T23:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496188#M138289</link>
      <description>&lt;P&gt;hi @msrama5&lt;BR /&gt;
I make the query from @606866581 advice.&lt;BR /&gt;
you say &lt;CODE&gt;it work&lt;/CODE&gt; , so you should accept the answer first.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 23:19:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496188#M138289</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-11T23:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496189#M138290</link>
      <description>&lt;P&gt;hi @606866581 thanks, it works, I need to add one more filter condition for values count in source1 sourcetype &amp;gt; 0 and only show those values , where to apply filter for source1 values count &amp;gt; 0 ?&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 23:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496189#M138290</guid>
      <dc:creator>msrama5</dc:creator>
      <dc:date>2020-05-11T23:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496190#M138291</link>
      <description>&lt;P&gt;the query result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Id source1 source2 source3 source4
-- ------- ------- ------- ------- 
X 1 1 1 1 
Y 0 1 1 1
Z 1 0 0 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;what you want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Id source1
-- ------- 
X 1
Z 1    
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this?    &lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 23:36:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496190#M138291</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-11T23:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496191#M138292</link>
      <description>&lt;P&gt;for example in below case source1 =0 values also shown&lt;BR /&gt;
Actual&lt;BR /&gt;
Id source1 source2 source3 source4&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;X 1 1 1 1 &lt;BR /&gt;
 Y 0 1 1 1&lt;BR /&gt;
 Z 1 0 0 1&lt;/P&gt;

&lt;P&gt;Expected- exclude &amp;lt;=0 values for source1 count, so output will be&lt;BR /&gt;
Id source1 source2 source3 source4&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;X 1 1 1 1 &lt;BR /&gt;
  Z 1 0 0 1&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 23:45:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496191#M138292</guid>
      <dc:creator>msrama5</dc:creator>
      <dc:date>2020-05-11T23:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496192#M138293</link>
      <description>&lt;P&gt;correct, want to exclude source1 count values &amp;lt;=0&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 00:00:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496192#M138293</guid>
      <dc:creator>msrama5</dc:creator>
      <dc:date>2020-05-12T00:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Join 4 source types with common field after eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496193#M138294</link>
      <description>&lt;P&gt;add&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where source1 &amp;gt; 0 
| table Id source1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2020 00:06:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-4-source-types-with-common-field-after-eval/m-p/496193#M138294</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-12T00:06:59Z</dc:date>
    </item>
  </channel>
</rss>

