<form script="table_icons_mv.js" stylesheet="table_decorations_shrunk.css">
  <label>Deployment Status</label>
  <fieldset submitButton="true">
    <input type="dropdown" token="index" searchWhenChanged="true">
      <label>Index</label>
      <choice value="*">All</choice>
      <fieldForLabel>Index</fieldForLabel>
      <fieldForValue>Index</fieldForValue>
      <default>*</default>
      <populatingSearch earliest="$earliest$" latest="$latest$" fieldForLabel="Index" fieldForValue="Index">|inputlookup avail_indexes.csv | dedup Index | sort + Index</populatingSearch>
    </input>
    <input type="multiselect" token="sourcetype" searchWhenChanged="true">
      <label>Sourcetype</label>
      <choice value="*">All</choice>
      <fieldForLabel>sourcetype</fieldForLabel>
      <fieldForValue>sourcetype</fieldForValue>
      <default>*</default>
      <valuePrefix>sourcetype=</valuePrefix>
      <delimiter> OR </delimiter>
      <populatingSearch earliest="-7d@h" latest="now" fieldForLabel="sourcetype" fieldForValue="sourcetype">| tstats values(sourcetype) AS st where index=$index$ by sourcetype  | fields - st</populatingSearch>
    </input>
    <input type="text" token="host" searchWhenChanged="true">
      <label>Host</label>
      <default>*</default>
    </input>
  </fieldset>
  <row>
    <panel>
      <table id="feed_status">
        <title>Host and Sourcetype Detail - Last 7 Days</title>
        <searchString>| tstats latest(_time) AS lastTime WHERE index=$index$ sourcetype!=stash $sourcetype$ host=*$host$* BY host sourcetype index | eval current=now() | eval age_min=round((current-lastTime)/60,2) | rangemap field=age_min default=severe low=0-30 elevated=30-60 | stats max(current) AS "Current Time" values(sourcetype) AS Sourcetypes list(lastTime) AS "Latest Event" list(age_min) AS age_min list(range) AS Status by host index | convert ctime(*Time) ctime("Latest Event")  | eventstats avg(age_min) AS avg_age by host | eval avg_age=round(avg_age,2) | sort - avg_age | rename  age_min AS "Communicated Minutes Ago" avg_age AS "Avg Communicated Minutes Ago"</searchString>
        <earliestTime>-7d@h</earliestTime>
        <latestTime>now</latestTime>
        <option name="wrap">true</option>
        <option name="rowNumbers">false</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</option>
        <option name="count">10</option>
      </table>
    </panel>
  </row>
</form>