<?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 Count all values in mv field, based on other value from mv field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-all-values-in-mv-field-based-on-other-value-from-mv-field/m-p/328181#M97696</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;
I need to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Count all values from mv field: blkio_stats.io_serviced_recursive{}.value where blkio_stats.io_serviced_recursive{}.op = write
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample data:&lt;BR /&gt;
&lt;A href="https://pastebin.com/7fKSwztE"&gt;https://pastebin.com/7fKSwztE&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks for help&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2017 11:54:50 GMT</pubDate>
    <dc:creator>Rialf1959</dc:creator>
    <dc:date>2017-10-27T11:54:50Z</dc:date>
    <item>
      <title>Count all values in mv field, based on other value from mv field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-all-values-in-mv-field-based-on-other-value-from-mv-field/m-p/328181#M97696</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I need to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Count all values from mv field: blkio_stats.io_serviced_recursive{}.value where blkio_stats.io_serviced_recursive{}.op = write
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample data:&lt;BR /&gt;
&lt;A href="https://pastebin.com/7fKSwztE"&gt;https://pastebin.com/7fKSwztE&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks for help&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 11:54:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-all-values-in-mv-field-based-on-other-value-from-mv-field/m-p/328181#M97696</guid>
      <dc:creator>Rialf1959</dc:creator>
      <dc:date>2017-10-27T11:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Count all values in mv field, based on other value from mv field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-all-values-in-mv-field-based-on-other-value-from-mv-field/m-p/328182#M97697</link>
      <description>&lt;P&gt;@Rialf1959, please try the following using &lt;CODE&gt;mvzip()&lt;/CODE&gt; function which should work as far as within multi-valued fields op and value there is one to one relationship. In other words &lt;CODE&gt;mvcount()&lt;/CODE&gt;of op field should match with value field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt;
| fields blkio_stats.io_serviced_recursive{}.op blkio_stats.io_serviced_recursive{}.value
| eval data=mvzip('blkio_stats.io_serviced_recursive{}.op','blkio_stats.io_serviced_recursive{}.value',";")
| table data
| mvexpand data
| search data="Write*"
| eval data=split(data,";")
| eval op=mvindex(data,0)
| eval value=mvindex(data,1)
| table op value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Refer to Splunk documentation for various Multi-value evaluation functions: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/MultivalueEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/MultivalueEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 15:23:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-all-values-in-mv-field-based-on-other-value-from-mv-field/m-p/328182#M97697</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-10-27T15:23:34Z</dc:date>
    </item>
  </channel>
</rss>

