<?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 Adding new expected Value to serach result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528097#M149093</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tried search some data from logs using this statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* sourcetype="mySource" Types* | stats count by Types &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in result I receive table like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type1&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type2&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type3&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I know that in the future in logs can occur Type4 so I would like to add it in to serach result by force. I tried some lookup stuff but i cant use it properly to get expected result.&lt;/P&gt;&lt;P&gt;So for now I would like to have table like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type1&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type2&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type3&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Type4&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Thanks in advice for help.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Nov 2020 11:36:33 GMT</pubDate>
    <dc:creator>mikroice90</dc:creator>
    <dc:date>2020-11-05T11:36:33Z</dc:date>
    <item>
      <title>Adding new expected Value to serach result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528097#M149093</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tried search some data from logs using this statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* sourcetype="mySource" Types* | stats count by Types &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in result I receive table like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type1&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type2&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type3&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I know that in the future in logs can occur Type4 so I would like to add it in to serach result by force. I tried some lookup stuff but i cant use it properly to get expected result.&lt;/P&gt;&lt;P&gt;So for now I would like to have table like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type1&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type2&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;Type3&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Type4&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Thanks in advice for help.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 11:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528097#M149093</guid>
      <dc:creator>mikroice90</dc:creator>
      <dc:date>2020-11-05T11:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new expected Value to serach result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528100#M149095</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228455"&gt;@mikroice90&lt;/a&gt;&amp;nbsp;.. maybe, check this idea -&lt;BR /&gt;EDIT - using eval, we can check if type4 exist, if its null, assign a zero value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* sourcetype="mySource" Types* | eval type4=if(isnull(type4),0,type4) | stats count by Types &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 12:11:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528100#M149095</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-11-05T12:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new expected Value to serach result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528101#M149096</link>
      <description>&lt;UL&gt;&lt;LI&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp; how it works in case: when logs with type4 will exist? It will still shows 0 instead of count value?&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 05 Nov 2020 12:09:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528101#M149096</guid>
      <dc:creator>mikroice90</dc:creator>
      <dc:date>2020-11-05T12:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new expected Value to serach result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528103#M149098</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228455"&gt;@mikroice90&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the if condition is checking if type4 is null, then it adds type4=0, if it is not null, then it will take the current value of type4.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 12:26:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528103#M149098</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-11-05T12:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new expected Value to serach result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528114#M149101</link>
      <description>&lt;P&gt;Brilliant, thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more question, This strings "Type1,Types2" etc. exist in more than one field in data set. Is it possible to count it all together instead of counting only by Types?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 13:14:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528114#M149101</guid>
      <dc:creator>mikroice90</dc:creator>
      <dc:date>2020-11-05T13:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Adding new expected Value to serach result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528146#M149114</link>
      <description>Please send example of events, so we could help you easier.&lt;BR /&gt;r. Ismo</description>
      <pubDate>Thu, 05 Nov 2020 15:08:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-new-expected-Value-to-serach-result/m-p/528146#M149114</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-11-05T15:08:30Z</dc:date>
    </item>
  </channel>
</rss>

