<?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: How do you use the rangemap and metadata commands in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305419#M91701</link>
    <description>&lt;P&gt;For a good use of &lt;CODE&gt;metadata&lt;/CODE&gt;, check out &lt;CODE&gt;Meta Woot!&lt;/CODE&gt; app:  &lt;A href="https://splunkbase.splunk.com/app/2949/"&gt;https://splunkbase.splunk.com/app/2949/&lt;/A&gt;&lt;BR /&gt;
It helps to know this (I think it should be on this page somewhere besides the comment section):&lt;/P&gt;

&lt;P&gt;The metadata command is essentially a macro around tstats. For the clueful, I will translate:&lt;BR /&gt;
The &lt;CODE&gt;firstTime&lt;/CODE&gt; field is &lt;CODE&gt;min(_time)&lt;/CODE&gt;.&lt;BR /&gt;
The &lt;CODE&gt;lastTime&lt;/CODE&gt; field is &lt;CODE&gt;max(_time)&lt;/CODE&gt;.&lt;BR /&gt;
The &lt;CODE&gt;recentTime&lt;/CODE&gt; field is &lt;CODE&gt;max(_indextime)&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I commented about this here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/567047/metadata-showing-wrong-last-indexed-time.html?childToView=567064#answer-567064"&gt;https://answers.splunk.com/answers/567047/metadata-showing-wrong-last-indexed-time.html?childToView=567064#answer-567064&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;As far as &lt;CODE&gt;rangemap&lt;/CODE&gt;, again, it helps to translate it to the basic commands that it uses to do what it does.  Looking at the examples on the docs page:&lt;BR /&gt;
Example 1:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rangemap field=date_second green=1-30 blue=31-39 red=40-59 default=gray
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is the same as this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval range=case(
      date_second&amp;gt;=1 AND date_second&amp;lt;=30, "green",
      date_second&amp;gt;=31 AND date_second&amp;lt;=39, "blue",
      date_second&amp;gt;=40 AND date_second&amp;lt;=59, "red",
      true(), "gray")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example 2:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rangemap field=count low=0-0 elevated=1-100 default=severe
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is the same as this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval range=case(
      count&amp;gt;=0 AND count&amp;lt;=0, "low",
      count&amp;gt;=1 AND count&amp;lt;=100, "elevated",
      true(), "severe")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 28 Nov 2017 18:14:50 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-11-28T18:14:50Z</dc:date>
    <item>
      <title>How do you use the rangemap and metadata commands in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305415#M91697</link>
      <description>&lt;P&gt;I'm trying to understand the usage of rangemap and metadata commands in splunk. I have gone through some documentation but haven't got the complete picture of those commands. It would be really helpfull if anyone can provide some information related to those commands.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 00:21:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305415#M91697</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-11-28T00:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rangemap and metadata commands in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305416#M91698</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
Have you tried these Splunk docs? &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Metadata"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Metadata&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Rangemap"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Rangemap&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Please go to these docs and let me know you need more understanding.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 07:12:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305416#M91698</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-11-28T07:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rangemap and metadata commands in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305417#M91699</link>
      <description>&lt;P&gt;@kamlesh_vaghela, I think you posted it too fast... You have provided a link to &lt;CODE&gt;Metasearch&lt;/CODE&gt; instead of &lt;CODE&gt;metadata&lt;/CODE&gt; command&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Metadata"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Metadata&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 10:21:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305417#M91699</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-28T10:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rangemap and metadata commands in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305418#M91700</link>
      <description>&lt;P&gt;@niketnilay,  ooh, my mistake. Answer updated. &lt;BR /&gt;
Thanks for the correction.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 10:46:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305418#M91700</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-11-28T10:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use the rangemap and metadata commands in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305419#M91701</link>
      <description>&lt;P&gt;For a good use of &lt;CODE&gt;metadata&lt;/CODE&gt;, check out &lt;CODE&gt;Meta Woot!&lt;/CODE&gt; app:  &lt;A href="https://splunkbase.splunk.com/app/2949/"&gt;https://splunkbase.splunk.com/app/2949/&lt;/A&gt;&lt;BR /&gt;
It helps to know this (I think it should be on this page somewhere besides the comment section):&lt;/P&gt;

&lt;P&gt;The metadata command is essentially a macro around tstats. For the clueful, I will translate:&lt;BR /&gt;
The &lt;CODE&gt;firstTime&lt;/CODE&gt; field is &lt;CODE&gt;min(_time)&lt;/CODE&gt;.&lt;BR /&gt;
The &lt;CODE&gt;lastTime&lt;/CODE&gt; field is &lt;CODE&gt;max(_time)&lt;/CODE&gt;.&lt;BR /&gt;
The &lt;CODE&gt;recentTime&lt;/CODE&gt; field is &lt;CODE&gt;max(_indextime)&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I commented about this here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/567047/metadata-showing-wrong-last-indexed-time.html?childToView=567064#answer-567064"&gt;https://answers.splunk.com/answers/567047/metadata-showing-wrong-last-indexed-time.html?childToView=567064#answer-567064&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;As far as &lt;CODE&gt;rangemap&lt;/CODE&gt;, again, it helps to translate it to the basic commands that it uses to do what it does.  Looking at the examples on the docs page:&lt;BR /&gt;
Example 1:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rangemap field=date_second green=1-30 blue=31-39 red=40-59 default=gray
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is the same as this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval range=case(
      date_second&amp;gt;=1 AND date_second&amp;lt;=30, "green",
      date_second&amp;gt;=31 AND date_second&amp;lt;=39, "blue",
      date_second&amp;gt;=40 AND date_second&amp;lt;=59, "red",
      true(), "gray")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example 2:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rangemap field=count low=0-0 elevated=1-100 default=severe
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is the same as this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval range=case(
      count&amp;gt;=0 AND count&amp;lt;=0, "low",
      count&amp;gt;=1 AND count&amp;lt;=100, "elevated",
      true(), "severe")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Nov 2017 18:14:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-use-the-rangemap-and-metadata-commands-in-Splunk/m-p/305419#M91701</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-11-28T18:14:50Z</dc:date>
    </item>
  </channel>
</rss>

