<?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: Can you help me with the where command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419247#M120528</link>
    <description>&lt;P&gt;Try this (stop using &lt;CODE&gt;dedup&lt;/CODE&gt; and surely your fields do not really have all of those spaces in them, do they?):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*" sourcetype="*"
| eval Boot_Duration=coalesce('Durée du démarrage',' Boot Duration', 'Startdauer', 'Duración del arranque')
| where Boot_Duration&amp;gt;100000
| stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 04 Mar 2019 10:30:10 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-03-04T10:30:10Z</dc:date>
    <item>
      <title>Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419242#M120523</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6642i868D10BA0CC98E6B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;Hello,&lt;/P&gt;

&lt;P&gt;I use the seatrch below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*" sourcetype="*"
| eval Boot_Duration=coalesce('Durée du démarrage      ','Boot Duration        ','Startdauer       ','Duración del arranque       ') 
| dedup host 
| stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Boot_Duration is a number value.&lt;/P&gt;

&lt;P&gt;I want to check only the number values &amp;gt;100000&lt;/P&gt;

&lt;P&gt;So I do&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where Boot_Duration&amp;gt;100000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But it doesn't work.&lt;/P&gt;

&lt;P&gt;Could you help me please??&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 15:15:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419242#M120523</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-03-01T15:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419243#M120524</link>
      <description>&lt;P&gt;You need to keep the boot duration on your stats command&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats count, values(Boot_Duration) as Boot_Duration by host&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Then you can your &lt;CODE&gt;| where Boot_Duration&amp;gt;100000&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 15:21:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419243#M120524</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-03-01T15:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419244#M120525</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="" sourcetype=""
| eval Boot_Duration=coalesce('Durée du démarrage ','Boot Duration ','Startdauer ','Duración del arranque ') 
| rex field=Boot_Duration (?P&amp;lt;Boot_Duration&amp;gt;^\d+)
| search Boot_Duration&amp;gt;=100000
| dedup host 
| stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your stats command 'looses' the Boot Duration field, so you either need to filter it before the &lt;CODE&gt;stats&lt;/CODE&gt;, or bring the field through after your stats command has produced results&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 15:23:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419244#M120525</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-01T15:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419245#M120526</link>
      <description>&lt;P&gt;tiago&lt;BR /&gt;
it doesnt works&lt;BR /&gt;
I think its because the boot duration has a value no?&lt;BR /&gt;
for example : 100000ms&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 07:29:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419245#M120526</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-03-04T07:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419246#M120527</link>
      <description>&lt;P&gt;@jip31 &lt;/P&gt;

&lt;P&gt;Can you please share sample events?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 07:33:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419246#M120527</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-03-04T07:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419247#M120528</link>
      <description>&lt;P&gt;Try this (stop using &lt;CODE&gt;dedup&lt;/CODE&gt; and surely your fields do not really have all of those spaces in them, do they?):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="*" sourcetype="*"
| eval Boot_Duration=coalesce('Durée du démarrage',' Boot Duration', 'Startdauer', 'Duración del arranque')
| where Boot_Duration&amp;gt;100000
| stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Mar 2019 10:30:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419247#M120528</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-04T10:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419248#M120529</link>
      <description>&lt;P&gt;responding to a comment above:&lt;/P&gt;

&lt;P&gt;"wait - Boot_Duration includes 'ms' too?&lt;BR /&gt;
This means its a string, not a number, and, you can't perform arithmetic logic on a string!"&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 10:48:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419248#M120529</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-04T10:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419249#M120530</link>
      <description>&lt;P&gt;I have edited the answer above to work if your duration field includes a unit of time (like 'ms')&lt;BR /&gt;
This works by taking just the digits and stripping any letters from the field, so you can perform math comparisons on the field. &lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 10:54:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419249#M120530</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-04T10:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419250#M120531</link>
      <description>&lt;P&gt;same problem...&lt;BR /&gt;
and unfortunately there is the space in the fields...&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 14:08:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419250#M120531</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-03-04T14:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419251#M120532</link>
      <description>&lt;P&gt;You mean that  i have to do something like this :&lt;BR /&gt;
 | where Boot_Duration&amp;gt;100000. "ms" ???&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 14:11:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419251#M120532</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-03-04T14:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419252#M120533</link>
      <description>&lt;P&gt;@jip31 can you paste here a couple of your events examples please ?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 14:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419252#M120533</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-03-04T14:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419253#M120534</link>
      <description>&lt;P&gt;Use rex to extract only the number part of the field and then use Boot_Duration&amp;gt;1000&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 14:18:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419253#M120534</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2019-03-04T14:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419254#M120535</link>
      <description>&lt;P&gt;No - try my example above. &lt;BR /&gt;
In this case I am performing a regex on your Boot_Duration field - I read the entire field contents which I (now) assume contains something like "100929ms"&lt;BR /&gt;
After the rex command, Boot_Duration will now only contain numbers ie "100929". Because this field is now numeric, you can perform &lt;CODE&gt;&amp;lt;&amp;gt;&lt;/CODE&gt; operations on the values.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:33:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419254#M120535</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-09-29T23:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419255#M120536</link>
      <description>&lt;P&gt;hi I have added the events in attachment&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 10:23:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419255#M120536</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-03-05T10:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419256#M120537</link>
      <description>&lt;P&gt;You need to pass &lt;CODE&gt;Boot_Duration&lt;/CODE&gt; through the &lt;CODE&gt;stats&lt;/CODE&gt; so try using this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count, max(Boot_Duration) as Boot_Duration BY host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or perhaps you would prefer &lt;CODE&gt;avg()&lt;/CODE&gt; or &lt;CODE&gt;min()&lt;/CODE&gt; over &lt;CODE&gt;max()&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 08:04:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419256#M120537</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-06T08:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419257#M120538</link>
      <description>&lt;P&gt;thanks woodcok but i prefer to use the code of nickhillscpl because I need a regex in order to extract "ms" after the boot duration....&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 07:40:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419257#M120538</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-03-07T07:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with the where command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419258#M120539</link>
      <description>&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 07:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-the-where-command/m-p/419258#M120539</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-03-07T07:42:41Z</dc:date>
    </item>
  </channel>
</rss>

