<?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 iterate over a field with multiple values to produce a new field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288887#M161643</link>
    <description>&lt;P&gt;Hi tpirozzi,&lt;BR /&gt;
could you explain better your need?&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 27 Mar 2017 12:05:43 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-03-27T12:05:43Z</dc:date>
    <item>
      <title>How to iterate over a field with multiple values to produce a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288885#M161641</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a test field with multiple values&lt;/P&gt;

&lt;P&gt;A&lt;BR /&gt;
B&lt;BR /&gt;
C&lt;BR /&gt;
D&lt;BR /&gt;
etc...&lt;/P&gt;

&lt;P&gt;in my splunk query I want to iterate over that field and build a new field &lt;/P&gt;

&lt;P&gt;A@B&lt;BR /&gt;
B@C&lt;BR /&gt;
C@D&lt;BR /&gt;
etc...&lt;/P&gt;

&lt;P&gt;Is there a way to accomplish this?&lt;BR /&gt;
I tried some different things with eval but not able to build that field.&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 10:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288885#M161641</guid>
      <dc:creator>tpirozzi</dc:creator>
      <dc:date>2017-03-27T10:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to iterate over a field with multiple values to produce a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288886#M161642</link>
      <description>&lt;P&gt;Use &lt;CODE&gt;streamstats&lt;/CODE&gt;. This is exactly a use case for it. &lt;/P&gt;

&lt;P&gt;Try this assuming your special field is called "MyField" and the new field is "MyField_new"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YOUR_BASE_SEARCH&amp;gt; 
| streamstats last(MyField) as prev 
| eval MyField_new = MyFields ."@". prev 
| fields - prev
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2017 11:48:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288886#M161642</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-03-27T11:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to iterate over a field with multiple values to produce a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288887#M161643</link>
      <description>&lt;P&gt;Hi tpirozzi,&lt;BR /&gt;
could you explain better your need?&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 12:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288887#M161643</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-03-27T12:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to iterate over a field with multiple values to produce a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288888#M161644</link>
      <description>&lt;P&gt;Trying to build information for a Sankey Diagram.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 13:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288888#M161644</guid>
      <dc:creator>tpirozzi</dc:creator>
      <dc:date>2017-03-27T13:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to iterate over a field with multiple values to produce a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288889#M161645</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 13:13:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288889#M161645</guid>
      <dc:creator>tpirozzi</dc:creator>
      <dc:date>2017-03-27T13:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to iterate over a field with multiple values to produce a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288890#M161646</link>
      <description>&lt;P&gt;This can also be done with the &lt;CODE&gt;autoregress&lt;/CODE&gt; command as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YOUR_BASE_SEARCH&amp;gt; 
| autoregress MyField 
| eval MyField_new = MyFields ."@". MyFields_p1
| fields - MyFields_p1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2017 17:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288890#M161646</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-27T17:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to iterate over a field with multiple values to produce a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288891#M161647</link>
      <description>&lt;P&gt;Thank you too&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 09:57:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-iterate-over-a-field-with-multiple-values-to-produce-a/m-p/288891#M161647</guid>
      <dc:creator>tpirozzi</dc:creator>
      <dc:date>2017-03-28T09:57:15Z</dc:date>
    </item>
  </channel>
</rss>

