<?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 merge a string in a list relatively to another string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497919#M194821</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;

&lt;P&gt;I want to add a string in a list which is in a field compared to another string which also is in another field.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8034iC8FFA092B455EDEF/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I want to add the string "&lt;STRONG&gt;webrtc&lt;/STRONG&gt;" in the list in the field &lt;STRONG&gt;Type&lt;/STRONG&gt; where in the field &lt;STRONG&gt;Type_call&lt;/STRONG&gt; there is "&lt;STRONG&gt;web&lt;/STRONG&gt;"&lt;/P&gt;

&lt;P&gt;I tried with the command eval(if(in)) but it didn't start because it replace the entire list in &lt;STRONG&gt;Type&lt;/STRONG&gt; by &lt;STRONG&gt;"webrtc"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;How can do that, please ?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 09:46:29 GMT</pubDate>
    <dc:creator>amir_bnp</dc:creator>
    <dc:date>2019-12-06T09:46:29Z</dc:date>
    <item>
      <title>merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497919#M194821</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;

&lt;P&gt;I want to add a string in a list which is in a field compared to another string which also is in another field.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8034iC8FFA092B455EDEF/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I want to add the string "&lt;STRONG&gt;webrtc&lt;/STRONG&gt;" in the list in the field &lt;STRONG&gt;Type&lt;/STRONG&gt; where in the field &lt;STRONG&gt;Type_call&lt;/STRONG&gt; there is "&lt;STRONG&gt;web&lt;/STRONG&gt;"&lt;/P&gt;

&lt;P&gt;I tried with the command eval(if(in)) but it didn't start because it replace the entire list in &lt;STRONG&gt;Type&lt;/STRONG&gt; by &lt;STRONG&gt;"webrtc"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;How can do that, please ?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 09:46:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497919#M194821</guid>
      <dc:creator>amir_bnp</dc:creator>
      <dc:date>2019-12-06T09:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497920#M194822</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="Type_call,Type
sip,Audio#Video
sip#web,Audio#video"
| multikv forceheader=1
| foreach Type*
    [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = split('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;',"#")]
| table Type_call Type
`comment("this is sample base data")`
| eval Type=if(mvfind(Type_call,"web") &amp;gt; 0, mvappend(Type,"webtrc"),Type)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, try this.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 12:55:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497920#M194822</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-06T12:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497921#M194823</link>
      <description>&lt;P&gt;Hello to4kawa,&lt;/P&gt;

&lt;P&gt;Thank you for you answer.&lt;/P&gt;

&lt;P&gt;How do you do that but without the makeresults and the sample of data  and the foreach?&lt;/P&gt;

&lt;P&gt;My data is contained as the table above and i have other string in addition to "Audio" and "Video".&lt;/P&gt;

&lt;P&gt;I have a field type_call and type and I want to do what I explained above but without using a data sample but with the data contained in the fields as splunk does.&lt;/P&gt;

&lt;P&gt;Thank you&lt;BR /&gt;
Amir &lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 08:30:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497921#M194823</guid>
      <dc:creator>amir_bnp</dc:creator>
      <dc:date>2019-12-09T08:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497922#M194824</link>
      <description>&lt;P&gt;This is the relevant line that does the work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval Type=if(mvfind(Type_call,"web") &amp;gt; 0, mvappend(Type,"webtrc"),Type)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The rest is setup. The mvfind is looking for the string 'web' in the Type_call and if found (&amp;gt;0) the it adds the webtrc field to the existing multivalue Type field&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 10:34:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497922#M194824</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2019-12-09T10:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497923#M194825</link>
      <description>&lt;P&gt;Hello @bowesmana , &lt;/P&gt;

&lt;P&gt;I already tried this but it didn't work.&lt;/P&gt;

&lt;P&gt;In my row which contains "sip" and "web" in the field Type_call, I don't have the "webrtc" which is added in the "Type" fields.&lt;/P&gt;

&lt;P&gt;Thanx&lt;BR /&gt;
Amir&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 10:44:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497923#M194825</guid>
      <dc:creator>amir_bnp</dc:creator>
      <dc:date>2019-12-09T10:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497924#M194826</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt; , that's right.&lt;BR /&gt;
so, hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/218370"&gt;@amir_bnp&lt;/a&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="Type_call,Type
sip,Audio#Video
sip#web,Audio#Video" 
| multikv forceheader=1 
| foreach "Type*" 
    [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = split('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;',"#")] 
| table Type_call Type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Have you checked this result first?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Type_call      Type
sip            Audio
               Video
----------------------------
sip            Audio
web            Video
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From this result, &lt;CODE&gt;webtrc&lt;/CODE&gt;  is added when the  query &lt;CODE&gt;eval&lt;/CODE&gt;  is executed.&lt;BR /&gt;
But if this doesn't work, it seems that &lt;EM&gt;Type_call&lt;/EM&gt; is &lt;STRONG&gt;not multivalue&lt;/STRONG&gt;, unlike the example given.&lt;/P&gt;

&lt;P&gt;what's your query?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:20:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497924#M194826</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-30T03:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497925#M194827</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Type=if(match(Type_call,"web"), mvappend(Type, "webrtc"), Type)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Dec 2019 11:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497925#M194827</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-12-09T11:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497926#M194828</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="Type_call,Type
sip,Audio#Video
sip#web,Audio#Video" 
| multikv forceheader=1 
| foreach "Type*" 
    [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = split('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;',"#")] 
| table Type_call Type
| nomv Type_call
| eval Type=if(match(Type_call,"web"), mvappend(Type, "webrtc"), Type)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works, thank you&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 11:56:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497926#M194828</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-09T11:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497927#M194829</link>
      <description>&lt;P&gt;I hadn't noticed that you have a similar approach in yours. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 12:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497927#M194829</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-12-09T12:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497928#M194830</link>
      <description>&lt;P&gt;hi @to4kawa ,&lt;/P&gt;

&lt;P&gt;your request works for the small table that I gave as an example but how do I change the request for it to work on a table containing the same fields but with thousands of lines?&lt;/P&gt;

&lt;P&gt;thank you and sorry if I did not understand at first.&lt;/P&gt;

&lt;P&gt;Amir&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 12:49:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497928#M194830</guid>
      <dc:creator>amir_bnp</dc:creator>
      <dc:date>2019-12-09T12:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497929#M194831</link>
      <description>&lt;P&gt;it works thank you @to4kawa .&lt;/P&gt;

&lt;P&gt;I used that :&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;...| table pole participant type_call_leg type | eval type=if(match(type_call_leg,"acano"), mvappend(type, "webrtc"), type)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and it works with the "match" and not "mvfind"&lt;/P&gt;

&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 13:00:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497929#M194831</guid>
      <dc:creator>amir_bnp</dc:creator>
      <dc:date>2019-12-09T13:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497930#M194832</link>
      <description>&lt;P&gt;thanks to you @arjunpkishore5  also for your request it works with the match&lt;/P&gt;

&lt;P&gt;Amir&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 13:05:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497930#M194832</guid>
      <dc:creator>amir_bnp</dc:creator>
      <dc:date>2019-12-09T13:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497931#M194833</link>
      <description>&lt;P&gt;The use of match and nomv rather then mvfind, is an indicator that the field was not multivalue or was hitting some MV field limit. In principle mvfind should work as a general rule.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 10:20:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497931#M194833</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2019-12-10T10:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: merge a string in a list relatively to another string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497932#M194834</link>
      <description>&lt;P&gt;ok thanks for this clarification.&lt;/P&gt;

&lt;P&gt;Amir &lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 10:28:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/merge-a-string-in-a-list-relatively-to-another-string/m-p/497932#M194834</guid>
      <dc:creator>amir_bnp</dc:creator>
      <dc:date>2019-12-10T10:28:51Z</dc:date>
    </item>
  </channel>
</rss>

