In the code below, I have all records when the SELECT-Only is checked, and only the SELECT-s when not checked - reverse behavior.
The ACTION_NAME fields values can be SELECT, INSERT, DELETE, UPDATE...... typical DB actions.
<form>
<label>Test 022</label>
<fieldset submitButton="false">
<input type="time" token="field_time">
<label>Time</label>
<default>
<earliest>-24h@h</earliest>
<latest>now</latest>
</default>
</input>
<input type="dropdown" token="field_db_name" searchWhenChanged="true">
<label>Database</label>
<prefix>"</prefix>
<suffix>"</suffix>
<default>*</default>
<fieldForLabel>LMS_DB_NAME</fieldForLabel>
<fieldForValue>LMS_DB_NAME</fieldForValue>
<search>
<query>index=omega_ca | DEDUP LMS_DB_NAME | FIELDS LMS_DB_NAME</query>
<earliest>$field_time.earliest$</earliest>
<latest>$field_time.latest$</latest>
</search>
</input>
<input type="checkbox" token="checkbox1" searchWhenChanged="true">
<label>SELECT-Only</label>
<choice value="SELECT">On</choice>
<change>
<condition match="$checkbox1$=="SELECT"">
<eval token="token2">"SELECT"</eval>
<!--<unset token="checkbox1"></unset>-->
</condition>
<condition>
<eval token="token2">"*"</eval>
</condition>
</change>
<delimiter> </delimiter>
</input>
</fieldset>
<row>
<panel>
<title>Records</title>
<table>
<search>
<query>index=omega_ca | search LMS_DB_NAME=$field_db_name$ ACTION_NAME=$token2$
| table _time, USERNAME, LMS_DB_NAME, LMS_DB_HOST, ACTION_NAME</query>
<earliest>$field_time.earliest$</earliest>
<latest>$field_time.latest$</latest>
</search>
<option name="count">16</option>
<option name="rowNumbers">true</option>
<option name="wrap">false</option>
</table>
</panel>
</row>
</form>
best regards
Altin
... View more