<?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: Using input file but only want select results returned in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682594#M233186</link>
    <description>&lt;P&gt;Let me know if anything else is needed&lt;/P&gt;</description>
    <pubDate>Mon, 01 Apr 2024 09:09:11 GMT</pubDate>
    <dc:creator>bullbasin</dc:creator>
    <dc:date>2024-04-01T09:09:11Z</dc:date>
    <item>
      <title>Using input file but only want select results returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682184#M233065</link>
      <description>&lt;P&gt;I have a dashboard where I have 4 multi select boxes and a input file with all possible results for each app.&amp;nbsp; When there are no results for an app it is sent as a 100%.&amp;nbsp; Problem is that the results have all apps and ignore the multi-select because of the input file.&amp;nbsp; Below is the code....&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;data.environment.application&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;data.environment.environment&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;data.environment.stack&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;data.componentId&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;app1&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;prod&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;AZ&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Acomp&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;app1&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;prod&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;AZ&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Bcomp&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;app2&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;uat&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;AW&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Zcomp&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;app2&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;uat&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;AW&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Ycomp&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;app2&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;uat&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;AW&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Xcomp&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;app3&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;prod&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;GC&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Mcomp&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=MINE data.environment.application="app2" data.environment.environment="uat"
| eval estack="AW"
| fillnull value="uat" estack data.environment.stack
| where 'data.environment.stack'=estack
| streamstats window=1 current=False global=False values(data.result) AS nextResult BY data.componentId
| eval failureStart=if((nextResult="FAILURE" AND 'data.result'="SUCCESS"), "True", "False"), failureEnd=if((nextResult="SUCCESS" AND 'data.result'="FAILURE"), "True", "False")
| transaction data.componentId, data.environment.application, data.environment.stack startswith="failureStart=True" endswith="failureEnd=True" maxpause=15m
| stats sum(duration) as downtime by data.componentId
| inputlookup append=true all_env_component.csv
| fillnull value=0
| addinfo
| eval uptime=(info_max_time - info_min_time)-downtime, avail=(uptime/(info_max_time - info_min_time))*100, downMins=round(downtime/60, 0)
| rename data.componentId AS Component, avail AS Availability
| fillnull value=100 Availability
| dedup Component
| table Component, Availability&lt;/LI-CODE&gt;
&lt;P&gt;Thank you in advance for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 20:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682184#M233065</guid>
      <dc:creator>bullbasin</dc:creator>
      <dc:date>2024-03-27T20:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using input file but only want select results returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682225#M233076</link>
      <description>&lt;P&gt;I cannot get a sense of this question.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;What is that data table at the beginning of this post supposed to be?&lt;/LI&gt;&lt;LI&gt;Right before inputlookup, you have a stats command that reduces data fields to &lt;U&gt;downtime&lt;/U&gt; and &lt;U&gt;data.componentId&lt;/U&gt;. &amp;nbsp;I assume that everything above inputlook is working as expected. &amp;nbsp;If this is the case, please just post sample/mock values of &lt;U&gt;downtime&lt;/U&gt; and &lt;U&gt;data.componentId&lt;/U&gt;&amp;nbsp;and ignore anything about app and input selection. (See below.)&lt;/LI&gt;&lt;LI&gt;What fields (columns) are in this&amp;nbsp;all_env_component.csv file? And how is this file useful to what you wanted in the end?&lt;/LI&gt;&lt;LI&gt;What exact is it that you wanted in the end? &amp;nbsp;By this, I mean what does "&lt;SPAN&gt;4 multi select boxes" have to do with this question? &amp;nbsp;Your search does not use a single token. &amp;nbsp;This means that none of these selections should have any effect of results.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;In short, you need to post data input - you can post just sample/mock values&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;downtime&lt;/U&gt;- &lt;U&gt;data.componentId&lt;/U&gt;&amp;nbsp;pairs; explain what is in that lookup file, provide some sample/mock values. &amp;nbsp;Then, explain what you are trying to do after that inputlookup, illustrate what your expected results look like from the sample/mock input values, and the logic between the input and desired results.&lt;/P&gt;&lt;P&gt;These are the basis of an answerable question in a forum about data analytics.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 04:10:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682225#M233076</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-03-28T04:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using input file but only want select results returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682250#M233088</link>
      <description>&lt;P&gt;Here are&amp;nbsp; the answers to your questions....&lt;BR /&gt;&lt;BR /&gt;1. It is the input file for the apps,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;all_env_component.csv&lt;/PRE&gt;&lt;P&gt;2. Yes it works correctly.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;data.componentId&lt;/TD&gt;&lt;TD&gt;downtime&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Ycomp&lt;/TD&gt;&lt;TD width="50%"&gt;322.186934&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Zcomp&lt;/TD&gt;&lt;TD width="50%"&gt;300.23822&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Xcomp&lt;/TD&gt;&lt;TD width="50%"&gt;&amp;nbsp;645.415504&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; The fields are,&amp;nbsp;&lt;/P&gt;&lt;TABLE width="719"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="200"&gt;data.environment.application&lt;/TD&gt;&lt;TD width="209"&gt;data.environment.environment&lt;/TD&gt;&lt;TD width="169"&gt;data.environment.stack&lt;/TD&gt;&lt;TD width="141"&gt;data.componentId&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. This is an availability dashboard.&amp;nbsp; The initial problemwas aby data.componentId that had 0 downtime would not show in the results, NULL.&amp;nbsp; This was fixed by adding an input file but then it was showing all the data.componentId and downtime.&amp;nbsp; The desired result is to just display only the&amp;nbsp;&amp;nbsp;data.componentId and downtime for the single&amp;nbsp;data.environment.application choosen in the drop down.&amp;nbsp; Below is the original query that would not display anything with 100% uptime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;index=MINE data.environment.application="app2" data.environment.environment="uat"&lt;BR /&gt;| eval estack="AW"&lt;BR /&gt;| fillnull value="uat" estack data.environment.stack&lt;BR /&gt;| where 'data.environment.stack'=estack&lt;BR /&gt;| streamstats window=1 current=False global=False values(data.result) AS nextResult BY data.componentId&lt;BR /&gt;| eval failureStart=if((nextResult="FAILURE" AND 'data.result'="SUCCESS"), "True", "False"), failureEnd=if((nextResult="SUCCESS" AND 'data.result'="FAILURE"), "True", "False")&lt;BR /&gt;| transaction data.componentId, data.environment.application, data.environment.stack startswith="failureStart=True" endswith="failureEnd=True" maxpause=15m&lt;BR /&gt;| stats sum(duration) as downtime by data.componentId&lt;BR /&gt;| addinfo&lt;BR /&gt;| eval uptime=(info_max_time - info_min_time)-downtime, avail=(uptime/(info_max_time - info_min_time))*100, downMins=round(downtime/60, 0)&lt;BR /&gt;| rename data.componentId AS Component, avail AS Availability&lt;BR /&gt;| table Component, Availability&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 09:40:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682250#M233088</guid>
      <dc:creator>bullbasin</dc:creator>
      <dc:date>2024-03-28T09:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using input file but only want select results returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682594#M233186</link>
      <description>&lt;P&gt;Let me know if anything else is needed&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 09:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682594#M233186</guid>
      <dc:creator>bullbasin</dc:creator>
      <dc:date>2024-04-01T09:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using input file but only want select results returned</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682723#M233231</link>
      <description>&lt;P&gt;any further input after answering your questions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 11:43:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-input-file-but-only-want-select-results-returned/m-p/682723#M233231</guid>
      <dc:creator>bullbasin</dc:creator>
      <dc:date>2024-04-02T11:43:52Z</dc:date>
    </item>
  </channel>
</rss>

