<?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: result from subquery with different source types in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584521#M203558</link>
    <description>&lt;P&gt;Can you provide some sample (anonymised) events showing when it doesn't work?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Feb 2022 12:40:28 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-02-10T12:40:28Z</dc:date>
    <item>
      <title>How to export a result with stats count of err_msg by Node and model?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584299#M203470</link>
      <description>&lt;P&gt;I have 3 different sourcetype like Result , Node and error under same index.&lt;/P&gt;
&lt;P&gt;Result has id , model&lt;/P&gt;
&lt;P&gt;Node has address, id, resultid (which is key to id in result)&lt;/P&gt;
&lt;P&gt;Error &amp;nbsp;has err_msg, id, nid (which is key to id in Node)&lt;/P&gt;
&lt;P&gt;I want to export a result with stats count of err_msg by Node and model. I tried with joins and subquery with IN operator from other query but no luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index= index1 sourcetype = Node&lt;/P&gt;
&lt;P&gt;[ search&amp;nbsp; index= index1 sourcetype = Error&amp;nbsp; | stats count by err_msg ]&lt;/P&gt;
&lt;P&gt;| stats count by id,err_msg&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 19:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584299#M203470</guid>
      <dc:creator>idofwasim</dc:creator>
      <dc:date>2022-02-09T19:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: result from subquery with different source types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584328#M203475</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 (sourcetype="Error" OR sourcetype="Result" OR sourcetype="Node")
| eval nid=if(sourcetype="Node",id,nid)
| eval resultId=if(sourcetype="Result",id,resultId)
| eventstats values(model) as model by resultId
| eventstats values(model) as model values(address) as address by nid
| where sourcetype="Error"
| stats count by nid model&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 09 Feb 2022 15:42:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584328#M203475</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-02-09T15:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: result from subquery with different source types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584517#M203556</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; Thanks for helping out. it almost works . I can see the stats count of err_msg and node . but when I add model, it doesnt show any results. any help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 11:39:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584517#M203556</guid>
      <dc:creator>idofwasim</dc:creator>
      <dc:date>2022-02-10T11:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: result from subquery with different source types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584521#M203558</link>
      <description>&lt;P&gt;Can you provide some sample (anonymised) events showing when it doesn't work?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 12:40:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584521#M203558</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-02-10T12:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to export a result with stats count of err_msg by Node and model?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584524#M203561</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/242852"&gt;@idofwasim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 (sourcetype="Error" OR sourcetype="Result" OR sourcetype="Node")
| eval cid=coalesce(id,resultid,nid)
| stats values(model) values(address) values(err_msg) by cid sourcetype
| search sourcetype="Error"
| rename values(*) as *
| eval err_count=mvcount(err_msg)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after this you can&amp;nbsp; customize or take stats as you want&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 12:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584524#M203561</guid>
      <dc:creator>AnilPujar</dc:creator>
      <dc:date>2022-02-10T12:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: result from subquery with different source types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584549#M203634</link>
      <description>&lt;P&gt;result source type&lt;/P&gt;&lt;P&gt;id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; model&lt;/P&gt;&lt;P&gt;100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aaa&lt;/P&gt;&lt;P&gt;101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bbb&amp;nbsp;&lt;/P&gt;&lt;P&gt;node source type&lt;/P&gt;&lt;P&gt;id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resultid&lt;/P&gt;&lt;P&gt;200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AAA&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;201&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BBB&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;202&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AAA&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&lt;/P&gt;&lt;P&gt;203&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CCC&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error source type&lt;/P&gt;&lt;P&gt;id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_msg&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nid&lt;/P&gt;&lt;P&gt;300&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500 error&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&lt;/P&gt;&lt;P&gt;301&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500 error&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201&lt;/P&gt;&lt;P&gt;302&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 404 Error&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 202&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i run with&amp;nbsp;&lt;SPAN&gt;stats count by nid err_msg&amp;nbsp;&lt;/SPAN&gt;then it give the count of err by node.&lt;/P&gt;&lt;P&gt;but if i add model at the end of stats (stats count by nid model&amp;nbsp; err_msg) it returns blank&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 15:38:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584549#M203634</guid>
      <dc:creator>idofwasim</dc:creator>
      <dc:date>2022-02-10T15:38:06Z</dc:date>
    </item>
    <item>
      <title>How to export a result with stats count of err_msg by Node and model?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584552#M203637</link>
      <description>&lt;P&gt;You might want to consider more relational database approach since your data seems to have normalized database structure and you want to analyze more. This way you would get a good structured data to play with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 sourcetype=Error | table err_msg, id, nid

| join type=left nid [ search index=index1 sourcetype=Node | table address, id, resultid | rename id as nid]

| join type=left resultid [ search index=index1 sourcetype=Result | table id , model | rename id as resultid]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 16:08:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584552#M203637</guid>
      <dc:creator>BahadirS</dc:creator>
      <dc:date>2022-02-10T16:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to export a result with stats count of err_msg by Node and model?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584852#M203734</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/242905"&gt;@BahadirS&lt;/a&gt;&amp;nbsp; Thank you so much , it worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Feb 2022 14:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-export-a-result-with-stats-count-of-err-msg-by-Node-and/m-p/584852#M203734</guid>
      <dc:creator>idofwasim</dc:creator>
      <dc:date>2022-02-12T14:05:29Z</dc:date>
    </item>
  </channel>
</rss>

