<?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 to setup multivalued fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-setup-multivalued-fields/m-p/116905#M31100</link>
    <description>&lt;P&gt;You're welcome! I'm glad if my answer was helpful.&lt;/P&gt;</description>
    <pubDate>Sun, 01 Feb 2015 11:31:46 GMT</pubDate>
    <dc:creator>echalex</dc:creator>
    <dc:date>2015-02-01T11:31:46Z</dc:date>
    <item>
      <title>How to setup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-setup-multivalued-fields/m-p/116902#M31097</link>
      <description>&lt;P&gt;Hi guys,&lt;BR /&gt;
I have a problem for which I've seen lots of answers but none worked for me. I have to say that I am a beginner in regex'es so maybe that's the problem. Nevertheless, I have made some tries that should have at least give me multiple values in the same event for a certain field, but it didn't, acting a little weird from my point of view. Having said that, I know my problem is quite simple and sorry for bothering you with this, but I need an example to get me going. So here's the situation:&lt;/P&gt;

&lt;P&gt;I have an ASCII file containing events separated by \n. The events look like this:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Time=[1/7/12 01:00:00],Efficiency=1,Fill=2772,Run=206194,MeanLB=59,MeanInt=3,BusySource=[CTP(LUCID),Pixel    ,SCT,TRT,L1Calo,BCM,LAr H/F,LAr EMEC,LAr EMB,MDT B,MDT EC,Tile EB,Tile LB,CSC,TGC,RPC,MUCTPI]&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Time=[1/7/12 11:00:00],Efficiency=0,Fill=2788,Run=0,MeanLB=0,MeanInt=0,BusySource=[0]&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;What I want to do is make a multivalued field called busy_item for which every item in BusySource is a value for the field. So that means that the busy_item field will have multiple values coming from each event or 0.&lt;/P&gt;

&lt;P&gt;I tried to do this by creating a new field extraction for which I would insert its regex rule. I tried lots of regex'es and none worked as I expected. The last one I tried is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?:BusySource=[,\[]+)(?P\w+[\(\w\)]*)(?:[,\]])
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which reads the 0s in [0] and just the first item in the multivalued BusySource. Even if I put a more general regex, it still just takes only one value per event. But I just started using regex'es.&lt;/P&gt;

&lt;P&gt;Another method I used was the TOKENIZER in fields.conf. I've followed the example there and made (it was none) a fields.conf in etc/local or in etc/myapp/local but nothing happened. I guess there are much more editing to do before you can see that field in your app (like in the other conf files).&lt;/P&gt;

&lt;P&gt;So, how do I extract the busy_item field?&lt;/P&gt;

&lt;P&gt;Thank you very much,&lt;BR /&gt;
Adrian&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:45:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-setup-multivalued-fields/m-p/116902#M31097</guid>
      <dc:creator>achitan</dc:creator>
      <dc:date>2020-09-28T18:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to setup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-setup-multivalued-fields/m-p/116903#M31098</link>
      <description>&lt;P&gt;Hi achitan,&lt;/P&gt;

&lt;P&gt;I guess that you already have BusySource as a field, because of the equals sign. So basically what you need to do is to copy BusySource to busy_item, drop the angle brackets and make busy_item a multivalued fields separated by commas.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search here&amp;gt; | rex field=BusySource "\[(?P&amp;lt;busy_item&amp;gt;[^\]]*)\]" |makemv delim="," busy_item
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does this do what you want?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-setup-multivalued-fields/m-p/116903#M31098</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2020-09-28T18:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to setup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-setup-multivalued-fields/m-p/116904#M31099</link>
      <description>&lt;P&gt;echalex, that was perfect! Thank you very very much!&lt;/P&gt;</description>
      <pubDate>Sun, 01 Feb 2015 11:03:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-setup-multivalued-fields/m-p/116904#M31099</guid>
      <dc:creator>achitan</dc:creator>
      <dc:date>2015-02-01T11:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to setup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-setup-multivalued-fields/m-p/116905#M31100</link>
      <description>&lt;P&gt;You're welcome! I'm glad if my answer was helpful.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Feb 2015 11:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-setup-multivalued-fields/m-p/116905#M31100</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2015-02-01T11:31:46Z</dc:date>
    </item>
  </channel>
</rss>

