<?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: I'm trying to move fields from multi value fields using mvindex. Currently under &amp;quot;time&amp;quot; field I have only 3 values so i am easily moving them as new field. Is there anyway to automate this process without hard coding it? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487263#M193809</link>
    <description>&lt;P&gt;What is the problem are you trying to solve? Creating many fields like this is rarely a good idea.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jan 2020 18:06:10 GMT</pubDate>
    <dc:creator>jpolvino</dc:creator>
    <dc:date>2020-01-14T18:06:10Z</dc:date>
    <item>
      <title>I'm trying to move fields from multi value fields using mvindex. Currently under "time" field I have only 3 values so i am easily moving them as new field. Is there anyway to automate this process without hard coding it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487262#M193808</link>
      <description>&lt;P&gt;time =  9:30 &lt;BR /&gt;
              10:30&lt;BR /&gt;
             11:30&lt;BR /&gt;
Currently I am doing this &lt;BR /&gt;
| eval first.time=mvindex(time, 1), second.time=mvindex(time, 2), third.time=mvindex(time, 3)&lt;/P&gt;

&lt;P&gt;This will give me first.time = 9:30, second.time= 10:30, third.time=11:30 fields moved from time field where it is a multivalued field. If i have &lt;STRONG&gt;undefined number of  fields&lt;/STRONG&gt; under this what should I do to automate it? instead of hardcoding it like | eval first.time=mvindex(time, 1), second.time=mvindex(time, 2), third.time=mvindex(time, 3) fourth.time=mvindex(time,4)............hundred.time=mvindex(time,100)&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 16:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487262#M193808</guid>
      <dc:creator>praneeth2050</dc:creator>
      <dc:date>2020-01-14T16:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: I'm trying to move fields from multi value fields using mvindex. Currently under "time" field I have only 3 values so i am easily moving them as new field. Is there anyway to automate this process without hard coding it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487263#M193809</link>
      <description>&lt;P&gt;What is the problem are you trying to solve? Creating many fields like this is rarely a good idea.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 18:06:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487263#M193809</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-01-14T18:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: I'm trying to move fields from multi value fields using mvindex. Currently under "time" field I have only 3 values so i am easily moving them as new field. Is there anyway to automate this process without hard coding it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487264#M193810</link>
      <description>&lt;P&gt;So, I am trying to create a Splunk report with the changes in time and changes in other fields.  The data I receive will have multiple time fields. For now i have only 3 time fields. In the future, I may even have 10 or 20-time fields... In the case of hardcoding using mvindex is there any alternative? &lt;/P&gt;

&lt;P&gt;PS: I have extracted this multivalued field using REGEX&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 18:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487264#M193810</guid>
      <dc:creator>praneeth2050</dc:creator>
      <dc:date>2020-01-14T18:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: I'm trying to move fields from multi value fields using mvindex. Currently under "time" field I have only 3 values so i am easily moving them as new field. Is there anyway to automate this process without hard coding it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487265#M193811</link>
      <description>&lt;P&gt;@niketnilay is it possible to help me out here? &lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 13:00:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487265#M193811</guid>
      <dc:creator>praneeth2050</dc:creator>
      <dc:date>2020-01-15T13:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: I'm trying to move fields from multi value fields using mvindex. Currently under "time" field I have only 3 values so i am easily moving them as new field. Is there anyway to automate this process without hard coding it?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487266#M193812</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults count=100
| streamstats current=f count
| eval time = (random() % 23).":30"
| stats list(time) as time
`comment("this is sample data, please check this")`
| eval counter=mvrange(0,mvcount(time))
| stats list(time) as time by counter
| eval time=mvindex(time,counter)
| sort 0 counter
| transpose 0 header_field=counter column_name=_col
| foreach *
    [rename &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; as time_&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @praneeth2050&lt;BR /&gt;
It's a boring name, but it works.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 13:44:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-m-trying-to-move-fields-from-multi-value-fields-using-mvindex/m-p/487266#M193812</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-15T13:44:24Z</dc:date>
    </item>
  </channel>
</rss>

