<form version="1.1">
  <label>Wireless Dashboard</label>
  <fieldset autoRun="true" submitButton="true">
    <input type="time" searchWhenChanged="true" token="time_token">
      <label></label>
      <default>
        <earliest>-60m@m</earliest>
        <latest>now</latest>
      </default>
    </input>
    <input type="dropdown" token="devname">
      <label>Device</label>
      <choice value="*">ANY</choice>
      <search>
        <query>| `_ftnt_dropdown(log.wireless, log.devname)`</query>
        <earliest>$time_token.earliest$</earliest>
        <latest>$time_token.latest$</latest>
      </search>
      <fieldForLabel>field_with_count</fieldForLabel>
      <fieldForValue>field</fieldForValue>
      <prefix>log.devname="</prefix>
      <suffix>"</suffix>
      <default>*</default>
      <change>
        <set token="devname_label">$label$</set>
        <set token="devname_value">$value$</set>
      </change>
    </input>
    <input type="dropdown" token="vdom" searchWhenChanged="true">
      <label>Virtual Domain</label>
      <choice value="*">ANY</choice>
      <search>
        <query>| `_ftnt_dropdown(log.wireless, log.vd)`</query>
        <earliest>$time_token.earliest$</earliest>
        <latest>$time_token.latest$</latest>
      </search>
      <fieldForLabel>field_with_count</fieldForLabel>
      <fieldForValue>field</fieldForValue>
      <prefix>log.vd="</prefix>
      <suffix>"</suffix>
      <default>*</default>
      <change>
        <set token="vdom_label">$label$</set>
        <set token="vdom_value">$value$</set>
      </change>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>Top Client Per-AP</title>
      <chart>
        <search>
          <query>| tstats summariesonly=true dc(log.wireless.stamac) FROM datamodel="ftnt_fos" WHERE nodename="log.wireless" log.vendor_action="client-ip-detected" $devname$ $vdom$   GROUPBY log.wireless.ap | sort -dc(log.wireless.stamac) | head 30</query>
          <earliest>$time_token.earliest$</earliest>
          <latest>$time_token.latest$</latest>
        </search>
        <option name="charting.chart">column</option>
        <option name="charting.axisY2.enabled">undefined</option>
        <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
        <option name="charting.axisLabelsX.majorLabelStyle.rotation">45</option>
        <option name="charting.axisTitleX.visibility">collapsed</option>
        <option name="charting.axisTitleY.visibility">collapsed</option>
        <option name="charting.axisTitleY2.visibility">visible</option>
        <option name="charting.axisX.scale">linear</option>
        <option name="charting.axisY.scale">linear</option>
        <option name="charting.axisY2.scale">inherit</option>
        <option name="charting.chart.bubbleMaximumSize">50</option>
        <option name="charting.chart.bubbleMinimumSize">10</option>
        <option name="charting.chart.bubbleSizeBy">area</option>
        <option name="charting.chart.nullValueMode">gaps</option>
        <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
        <option name="charting.chart.stackMode">default</option>
        <option name="charting.chart.style">shiny</option>
        <option name="charting.drilldown">all</option>
        <option name="charting.layout.splitSeries">0</option>
        <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
        <option name="charting.legend.placement">none</option>
        <drilldown>
          <link>
            <![CDATA[
                /app/SplunkAppForFortinet/search?q= `fortigate_wireless` (vendor_action="client-ip-detected" devname="$devname_value$" vd="$vdom_value$") (ap="$click.value$")&earliest=$time_token.earliest$&latest=$time_token.latest$
				]]>
          </link>
        </drilldown>
      </chart>
    </panel>
  </row>
  <row>
    <panel>
      <title>Rogue AP</title>
      <table>
        <search>
          <query>| tstats summariesonly=true max(_time) AS NTime  count FROM datamodel="ftnt_fos" WHERE nodename="log.wireless"  $devname$ $vdom$ log.vendor_action="rogue-ap-detected" groupby log.wireless.apstatus, log.wireless.manuf, log.wireless.bssid, log.wireless.security, log.wireless.radioband, log.wireless.channel, log.wireless.sndetected, log.wireless.signal, log.wireless.onwire | rename log.wireless.apstatus AS Status, log.wireless.manuf AS Vendor, log.wireless.bssid AS BSSID, log.wireless.security AS Security, log.wireless.radioband AS RadioBand, log.wireless.channel AS Channel, log.wireless.sndetected AS Detected-By, log.wireless.signal AS Signal, log.wireless.onwire AS OnWire | sort -_time |  convert ctime(NTime) as Time | table Time, Status, Vendor, BSSID, Security, RadioBand, Channel, Detected-By, Signal, OnWire</query>
          <earliest>$time_token.earliest$</earliest>
          <latest>$time_token.latest$</latest>
        </search>
        <option name="charting.chart">column</option>
        <option name="charting.axisY2.enabled">undefined</option>
        <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
        <option name="charting.axisLabelsX.majorLabelStyle.rotation">45</option>
        <option name="charting.axisTitleX.visibility">collapsed</option>
        <option name="charting.axisTitleY.visibility">collapsed</option>
        <option name="charting.axisTitleY2.visibility">visible</option>
        <option name="charting.axisX.scale">linear</option>
        <option name="charting.axisY.scale">linear</option>
        <option name="charting.axisY2.scale">inherit</option>
        <option name="charting.chart.bubbleMaximumSize">50</option>
        <option name="charting.chart.bubbleMinimumSize">10</option>
        <option name="charting.chart.bubbleSizeBy">area</option>
        <option name="charting.chart.nullValueMode">gaps</option>
        <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
        <option name="charting.chart.stackMode">default</option>
        <option name="charting.chart.style">shiny</option>
        <option name="charting.drilldown">all</option>
        <option name="charting.layout.splitSeries">0</option>
        <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
        <option name="charting.legend.placement">none</option>
        <option name="wrap">true</option>
        <option name="rowNumbers">false</option>
        <option name="dataOverlayMode">none</option>
        <option name="list.drilldown">full</option>
        <option name="list.wrap">1</option>
        <option name="maxLines">5</option>
        <option name="raw.drilldown">full</option>
        <option name="table.drilldown">all</option>
        <option name="table.wrap">1</option>
        <option name="type">list</option>
        <option name="count">10</option>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</form>
