Getting Data In

How to extract the first and last start time (as conditional term) and only use them in a search?

sina_shafaei
Explorer

Hi Guys,

in my data I have time slots in this format:

starttime="1403032818"

for each field. the number of starttimes are 17 (search was run on the data in 17 different times) for the whole data and I only need to use the first and last start times in my search, for example if we assume the whole times like this: 140153402,...., 1402513801, 1403032818

I only need my search to run on the fields which contains the first (140153402) and the last (1403032818) start time and ignore the results regard the start times in between .

How can I add this conditional (?) term to my search?

Thank you so much in advance for your help.

0 Karma

somesoni2
SplunkTrust
SplunkTrust

See this run anywhere example with two data inputs.

<form>
  <label>Two input Form</label>
  <description/>
  <fieldset submitButton="false">
    <input type="dropdown" token="sourcetype" searchWhenChanged="true">
      <label>Sourcetype</label>
      <populatingSearch fieldForLabel="sourcetype" fieldForValue="sourcetype">index=_internal | stats count  by sourcetype</populatingSearch>
    </input>
    <input type="dropdown" token="source" searchWhenChanged="true">
          <label>Source</label>
          <populatingSearch fieldForLabel="source" fieldForValue="source">index=_internal | stats count  by source</populatingSearch>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <searchString>index=_internal sourcetype=$sourcetype$ source=$source$| timechart count</searchString>
        <earliestTime>-60m@m</earliestTime>
        <latestTime>now</latestTime>        
        <option name="wrap">true</option>
        <option name="rowNumbers">false</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">cell</option>
      </table>
    </panel>
  </row>
</form>
0 Karma

somesoni2
SplunkTrust
SplunkTrust

What is your current search query?

0 Karma

sina_shafaei
Explorer

it's just a normal query e.g showing a table based for two variables. actually I want to use this "start time" as a variable (using an input like drop-down menu) for my dashboard (form) to choose the result based on first or last or both times and ignore the other start times and results related to them, but I have no idea how to do that?

I've used it for normal search like this:

index=remedy 1403032818 OR 140153402 | (rest of the search) ....

but for a form using drop-down menu ...?

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...