<?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: Check if Field is a Multivalue Field in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490204#M8259</link>
    <description>&lt;P&gt;I just read about the &lt;CODE&gt;mvcount&lt;/CODE&gt; function. I guess that can be used to count the number of values in the field and check if there are any counts higher than one. &lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2019 09:25:28 GMT</pubDate>
    <dc:creator>thomasvanhelden</dc:creator>
    <dc:date>2019-11-26T09:25:28Z</dc:date>
    <item>
      <title>Check if Field is a Multivalue Field</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490203#M8258</link>
      <description>&lt;P&gt;Is it possible to check if a certain field is a multi-value field? &lt;/P&gt;

&lt;P&gt;I'm rewriting some old searches. They contain a few &lt;CODE&gt;mvexpand&lt;/CODE&gt; commands, but I'm not sure whether this is necessary or not. &lt;BR /&gt;
I don't know how to verify if the &lt;CODE&gt;mvexpand&lt;/CODE&gt; is required and it seems risky to just leave it out and see if the search still works. &lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 07:44:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490203#M8258</guid>
      <dc:creator>thomasvanhelden</dc:creator>
      <dc:date>2019-11-26T07:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Check if Field is a Multivalue Field</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490204#M8259</link>
      <description>&lt;P&gt;I just read about the &lt;CODE&gt;mvcount&lt;/CODE&gt; function. I guess that can be used to count the number of values in the field and check if there are any counts higher than one. &lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 09:25:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490204#M8259</guid>
      <dc:creator>thomasvanhelden</dc:creator>
      <dc:date>2019-11-26T09:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Check if Field is a Multivalue Field</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490205#M8260</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults count=2 
| streamstats count 
| eval _time = if (count==2,relative_time(_time,"-1d@d"), relative_time(_time,"@d")) 
| makecontinuous span=15m 
| fillnull 
| where count!=1 
| eval count = random() % 50  
| eval count2 = count % 2 + 1
| eval count3 = count % 3 + 1
| bin span=1h aligntime=-1h@h _time 
| stats list(count) as count values(count2) as count2 values(count3) as count3 by _time 
`comment("this is sample data")`
| eval check="" 
| foreach "*" 
    [ eval check=if(mvcount(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;) &amp;gt; 1 ,mvappend(check,"&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;") ,check) ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @thomasvanhelden &lt;BR /&gt;
How about it?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 13:56:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490205#M8260</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-26T13:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Check if Field is a Multivalue Field</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490206#M8261</link>
      <description>&lt;P&gt;Hi @thomasvanhelden ,&lt;/P&gt;

&lt;P&gt;Just a thought, why dont you keep the mvexpand command as is. If it is single value field mvexpand will do nothing. and if that field is a mv field then only mvexpand will work.&lt;/P&gt;

&lt;P&gt;Sid&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 14:01:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490206#M8261</guid>
      <dc:creator>techiesid</dc:creator>
      <dc:date>2019-11-26T14:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Check if Field is a Multivalue Field</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490207#M8262</link>
      <description>&lt;P&gt;It would probably be better to figure-out what the search is trying to do in the first place&lt;/P&gt;

&lt;P&gt;There may be better ways of finding what the searches are trying to do - given that these ones you're looking at are "old"&lt;/P&gt;

&lt;P&gt;Or there might not &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;That said, &lt;CODE&gt;mvexpand&lt;/CODE&gt; doesn't really &lt;EM&gt;hurt&lt;/EM&gt; you if the field is &lt;EM&gt;not&lt;/EM&gt; multivalue (there's a tiny performance hit, but it's pretty small)&lt;/P&gt;

&lt;P&gt;In my experience, I "know" a field [may] be multivalue in one of two instances:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;it comes out of JSON &lt;/LI&gt;
&lt;LI&gt;there was a &lt;CODE&gt;| stats list()&lt;/CODE&gt; or &lt;CODE&gt;| stats values()&lt;/CODE&gt; that built the field in question&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;If neither of those is true, it's &lt;EM&gt;probably&lt;/EM&gt; not multivalue&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 15:23:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490207#M8262</guid>
      <dc:creator>wmyersas</dc:creator>
      <dc:date>2019-11-26T15:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Check if Field is a Multivalue Field</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490208#M8263</link>
      <description>&lt;P&gt;Sounds like if your search has multivalue fields &amp;amp; you want them separated out, then you use it... &lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Mvexpand"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Mvexpand&lt;/A&gt;&lt;BR /&gt;
"Expands the values of a multivalue field into separate events, one event for each value in the multivalue field. For each result, the mvexpand command creates a new result for every multivalue field." &lt;BR /&gt;
If you don't want them separated, then you don't. &lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 17:35:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490208#M8263</guid>
      <dc:creator>lkutch_splunk</dc:creator>
      <dc:date>2019-11-26T17:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Check if Field is a Multivalue Field</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490209#M8264</link>
      <description>&lt;P&gt;You can use &lt;CODE&gt;mvcount&lt;/CODE&gt; for this.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 17:39:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490209#M8264</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-26T17:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Check if Field is a Multivalue Field</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490210#M8265</link>
      <description>&lt;P&gt;OP's already using &lt;CODE&gt;mvexpand&lt;/CODE&gt; - he's trying to figure out if he needs to or not &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 19:03:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490210#M8265</guid>
      <dc:creator>wmyersas</dc:creator>
      <dc:date>2019-11-26T19:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Check if Field is a Multivalue Field</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490211#M8266</link>
      <description>&lt;P&gt;This is a solution to my problem! I built something similar myself. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 10:58:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Check-if-Field-is-a-Multivalue-Field/m-p/490211#M8266</guid>
      <dc:creator>thomasvanhelden</dc:creator>
      <dc:date>2019-11-27T10:58:26Z</dc:date>
    </item>
  </channel>
</rss>

