<?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: Issue getting multi-value field to correlate properly in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Issue-getting-multi-value-field-to-correlate-properly/m-p/296041#M3749</link>
    <description>&lt;P&gt;Try these&lt;/P&gt;

&lt;P&gt;Use list function of stats instead of values. The values function gives sorted , unique values of the field hence the non-correlated ordering&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search
|stats list(license_type) list(license_avail) list(license_used) by node 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR, make the report linear by expanding multivalued fields.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search
| fields node license_type license_avail license_used
| eval temp=mvzip(mvzip(license_type,license_avail,"##"),license_used,"##")
| mvexpand temp 
| rex field=temp "(?&amp;lt;license_type&amp;gt;[^#]+)##(?&amp;lt;license_avail&amp;gt;[^#]+)##(?&amp;lt;license_used&amp;gt;.+)"
| table node license_type license_avail license_used
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 28 Mar 2018 23:27:12 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-03-28T23:27:12Z</dc:date>
    <item>
      <title>Issue getting multi-value field to correlate properly</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Issue-getting-multi-value-field-to-correlate-properly/m-p/296040#M3748</link>
      <description>&lt;P&gt;I have an existing data set that provides a dump of multiple data points in a single event.  The data set looks something like this:&lt;/P&gt;

&lt;P&gt;HOSTNAME = "NODE1"&lt;BR /&gt;
License Type: MAIN INSTALLED.Count: 1 Mainboard: 0 I/O 1: 0 MFP 2: 0 Total Licenses in Use: 0&lt;BR /&gt;
License Type: TRANSRATE INSTALLED.Count: 12 Mainboard: 0 I/O 1: 0 MFP 2: 0 Total Licenses in Use: 9&lt;BR /&gt;
License Type: EXTENSION is NOT INSTALLED&lt;/P&gt;

&lt;P&gt;And the data set continues with about 50 more license types per node.  I've been able to set up extraction of various fields (node, license_type, license_avail, license_used) using props.conf and transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf
[license]
EXTRACT-hostname = HOSTNAME=\"(?&amp;lt;node&amp;gt;\w+)\"
REPORT-license_type = license_type
REPORT-license_available = license_available
REPORT-license_used = license_used

transforms.conf
[license_type]
REGEX = License\sType:\s(?&amp;lt;license_type&amp;gt;\w+)\sINSTALLED\.Count
FORMAT = license_type::$1
MV_ADD = true

[license_available]
REGEX = INSTALLED\.Count\s(?&amp;lt;license_avail&amp;gt;\d+)\s+
FORMAT = license_avail::$1
MV_ADD = true

[license_used]
REGEX = \s+Total\sLicenses\sin\sUse:\s(?&amp;lt;license_used&amp;gt;\d+)
FORMAT = license_used::$1
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;These seem to be working fine - I'm able to extract and see a list of all of the available licenses on the system (i.e. MAIN, TRANSRATE); the count of all available licenses (i.e. 1, 12), and the count of licenses actually in use (i.e. 0, 9).  The problem I'm having is correlating this data together in an actual report for the users.  I can't seem to make the numbers line up properly.  I've tried numerous stats, charts, and other commands, but can't seem to make it line up into what should be a fairly simple report -  For each node, list installed license types with a count of licenses available and licenses in use:&lt;/P&gt;

&lt;P&gt;Host          Type                     Available          Used&lt;BR /&gt;
NODE1      MAIN                   1                        0&lt;BR /&gt;
NODE1      TRANSRATE        12                      9&lt;/P&gt;

&lt;P&gt;What I've ended up with is usually the same values for each license type or a completely unordered list with no correlation between the counts and the license type.  Some of the searches I've used are:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats values(license_type) values(license_avail) values(license_used) by node    - returns uncorrelated list of numbers

|stats latest(license_type) latest(license_avail) latest(license_used) by node        - returns visually what I'm looking for but only 1 license type per node
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm sure there's something pretty simple that I'm missing here but I appreciate any help...&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:43:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Issue-getting-multi-value-field-to-correlate-properly/m-p/296040#M3748</guid>
      <dc:creator>burras</dc:creator>
      <dc:date>2020-09-29T18:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issue getting multi-value field to correlate properly</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Issue-getting-multi-value-field-to-correlate-properly/m-p/296041#M3749</link>
      <description>&lt;P&gt;Try these&lt;/P&gt;

&lt;P&gt;Use list function of stats instead of values. The values function gives sorted , unique values of the field hence the non-correlated ordering&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search
|stats list(license_type) list(license_avail) list(license_used) by node 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR, make the report linear by expanding multivalued fields.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search
| fields node license_type license_avail license_used
| eval temp=mvzip(mvzip(license_type,license_avail,"##"),license_used,"##")
| mvexpand temp 
| rex field=temp "(?&amp;lt;license_type&amp;gt;[^#]+)##(?&amp;lt;license_avail&amp;gt;[^#]+)##(?&amp;lt;license_used&amp;gt;.+)"
| table node license_type license_avail license_used
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Mar 2018 23:27:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Issue-getting-multi-value-field-to-correlate-properly/m-p/296041#M3749</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-03-28T23:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Issue getting multi-value field to correlate properly</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Issue-getting-multi-value-field-to-correlate-properly/m-p/296042#M3750</link>
      <description>&lt;P&gt;Thanks - using list fixed up the issue.  Appreciate the help!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 15:34:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Issue-getting-multi-value-field-to-correlate-properly/m-p/296042#M3750</guid>
      <dc:creator>burras</dc:creator>
      <dc:date>2018-03-30T15:34:10Z</dc:date>
    </item>
  </channel>
</rss>

