<?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: MVINDEX not working well with SPACE separated values in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371009#M67388</link>
    <description>&lt;P&gt;My &lt;STRONG&gt;cpuidle&lt;/STRONG&gt; shows up blank.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                   cpuUsage                    cpuFields   cpuIdle
2017-10-04 22:00:17     2.02 0.00 1.01 0.00 96.97   2.02    
                                                    0.00
                                                    1.01
                                                    0.00
                                                    96.97
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 05 Oct 2017 02:23:40 GMT</pubDate>
    <dc:creator>mrigs</dc:creator>
    <dc:date>2017-10-05T02:23:40Z</dc:date>
    <item>
      <title>MVINDEX not working well with SPACE separated values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371006#M67385</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;

&lt;P&gt;For an event like this -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CPU    uPct    nPct  sPct  wPct    iPct
all       0.63       0.00       0.38       0.00      98.99
0         0.00       0.00       0.00       0.00     100.00
1         1.00       0.00       0.00       0.00      99.00
2         0.00       0.00       0.00       0.00     100.00
3         0.00       0.00       0.00       0.00     100.00
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract the &lt;STRONG&gt;iPct&lt;/STRONG&gt; value for the &lt;STRONG&gt;all&lt;/STRONG&gt; row. For some reason my &lt;STRONG&gt;split&lt;/STRONG&gt; and &lt;STRONG&gt;mvindex&lt;/STRONG&gt; commands are not working properly. This is what I have tried -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;*&amp;lt;base search&amp;gt;*
| rex field=_raw "all(?&amp;lt;cpuUsage&amp;gt;.*)\\n"
| eval cpuFields = split(cpuUsage, " ")
| eval cpuIdle = mvindex(cpuFields,4)
| table _time, cpuIdle
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The separation works fine, but may be I am doing something wrong with the &lt;STRONG&gt;mvindex&lt;/STRONG&gt;? Please advise!&lt;/P&gt;

&lt;P&gt;Thank you&lt;BR /&gt;
M&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2017 23:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371006#M67385</guid>
      <dc:creator>mrigs</dc:creator>
      <dc:date>2017-09-30T23:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: MVINDEX not working well with SPACE separated values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371007#M67386</link>
      <description>&lt;P&gt;what does cpuidle return for you?&lt;BR /&gt;
i think maybe, you need to use -&lt;BR /&gt;
| eval cpuIdle = mvindex(cpuFields,5) to get ipct values?&lt;BR /&gt;
Can you please post a screen shot of what your CURRENT query returns?&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2017 13:12:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371007#M67386</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2017-10-01T13:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: MVINDEX not working well with SPACE separated values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371008#M67387</link>
      <description>&lt;P&gt;The problem might be that there are multiple spaces between the values.  &lt;/P&gt;

&lt;P&gt;Since you only want the last value on the line, this would be simpler.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; *&amp;lt;base search&amp;gt;*
 | rex field=_raw "all.*\s(?&amp;lt;cpuIdle&amp;gt;\S+)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...or if you wanted everything on the all line...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex "^(?&amp;lt;CPU&amp;gt;all)\s+(?&amp;lt;uPct&amp;gt;\S+)\s+(?&amp;lt;nPct&amp;gt;\S+)\s+(?&amp;lt;sPct&amp;gt;\S+)\s+(?&amp;lt;wPct&amp;gt;\S+)\s+(?&amp;lt;iPct&amp;gt;\S+)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...or on all lines... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex "^(?&amp;lt;CPU&amp;gt;\S+)\s+(?&amp;lt;uPct&amp;gt;\S+)\s+(?&amp;lt;nPct&amp;gt;\S+)\s+(?&amp;lt;sPct&amp;gt;\S+)\s+(?&amp;lt;wPct&amp;gt;\S+)\s+(?&amp;lt;iPct&amp;gt;\S+)$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Oct 2017 16:14:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371008#M67387</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-01T16:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: MVINDEX not working well with SPACE separated values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371009#M67388</link>
      <description>&lt;P&gt;My &lt;STRONG&gt;cpuidle&lt;/STRONG&gt; shows up blank.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                   cpuUsage                    cpuFields   cpuIdle
2017-10-04 22:00:17     2.02 0.00 1.01 0.00 96.97   2.02    
                                                    0.00
                                                    1.01
                                                    0.00
                                                    96.97
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2017 02:23:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371009#M67388</guid>
      <dc:creator>mrigs</dc:creator>
      <dc:date>2017-10-05T02:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: MVINDEX not working well with SPACE separated values</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371010#M67389</link>
      <description>&lt;P&gt;Thank you. A bit crude, but this worked for me -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "all(?:.*) (?&amp;lt;cpuIdle&amp;gt;([0-9]|\.)+)\\n"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It would still be interesting to find out why my SPLIT didn't work as expected!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 02:26:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/MVINDEX-not-working-well-with-SPACE-separated-values/m-p/371010#M67389</guid>
      <dc:creator>mrigs</dc:creator>
      <dc:date>2017-10-05T02:26:45Z</dc:date>
    </item>
  </channel>
</rss>

