<?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 split events into multiple rows in a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429620#M122884</link>
    <description>&lt;P&gt;it just split ifName field, not for ifName ifIn ifOut ifSpeed fields. I use the way of @kamlesh_vaghela and the problem is solved. Anyway, thank your help.&lt;/P&gt;</description>
    <pubDate>Wed, 30 May 2018 06:32:53 GMT</pubDate>
    <dc:creator>dailv1808</dc:creator>
    <dc:date>2018-05-30T06:32:53Z</dc:date>
    <item>
      <title>How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429607#M122871</link>
      <description>&lt;P&gt;I have the following search result which has multiple values in a cell:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="Split table raw"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5092i2AFAFB1130422BF1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Split table raw" alt="Split table raw" /&gt;&lt;/span&gt;&lt;BR /&gt;
I would like to split table to raws. look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time                                             |               ifName           |                    ifIn                     |                    ifOut                   |            ifSpeed
2018-05-29 15:0514                  |               mgmt0            |                    2725909466    |               445786495              |     1000000000
2018-05-29 15:0514                  |               Vlan1               |                    2739931731    |               807226632              |     1000000000
2018-05-29 15:0514                  |               Vlan30             |                    925889480      |               694417752              |     1000000000
2018-05-29 15:0514                  |               Vlan100           |                     925889308     |               694418432              |     1000000000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;v.v&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 08:20:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429607#M122871</guid>
      <dc:creator>dailv1808</dc:creator>
      <dc:date>2018-05-29T08:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429608#M122872</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Can you please try following search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH
| eval tempField= mvzip(mvzip(mvzip(ifName,ifIn),ifOut),ifSpeed) 
| stats count by _time tempField
| eval ifName = mvindex(split(tempField,","),0), ifIn= mvindex(split(tempField,","),1), ifOut=mvindex(split(tempField,","),2), ifSpeed=mvindex(split(tempField,","),2)  
| table _time ifName ifIn ifOut ifSpeed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 09:29:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429608#M122872</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-05-29T09:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429609#M122873</link>
      <description>&lt;P&gt;why are you so smart. yeah, it's work. But it doesn't arranged in the correct order of the interface list. so What need i to do to sort by interface name as order in log.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://imgur.com/a/QN89Jqg"&gt;https://imgur.com/a/QN89Jqg&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 09:45:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429609#M122873</guid>
      <dc:creator>dailv1808</dc:creator>
      <dc:date>2018-05-29T09:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429610#M122874</link>
      <description>&lt;P&gt;As mentioned in my comment in the related question: &lt;A href="https://answers.splunk.com/comments/662403/view.html"&gt;https://answers.splunk.com/comments/662403/view.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Manually defining a sourcetype as follows in props.conf works like a charm to split your raw data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[snmptest]
DATETIME_CONFIG=CURRENT
SHOULD_LINEMERGE=false
NO_BINARY_CHECK=true
LINE_BREAKER=(\s+)IF-MIB::ifName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which is much cleaner and much more reliable than messing around with multivalued fields.&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 09:45:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429610#M122874</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-05-29T09:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429611#M122875</link>
      <description>&lt;P&gt;Hi @dailv1808,&lt;BR /&gt;
Just use sort command to sort results.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.0/SearchReference/Sort"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.0/SearchReference/Sort&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;if you want to sort on time as well as Interface name then put &lt;CODE&gt;sort&lt;/CODE&gt; command before &lt;CODE&gt;table&lt;/CODE&gt;.&lt;BR /&gt;
like,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; YOUR_SEARCH
 | eval tempField= mvzip(mvzip(mvzip(ifName,ifIn),ifOut),ifSpeed) 
 | stats count by _time tempField
 | eval ifName = mvindex(split(tempField,","),0), ifIn= mvindex(split(tempField,","),1), ifOut=mvindex(split(tempField,","),2), ifSpeed=mvindex(split(tempField,","),2)  
| sort _time ifName 
| table _time ifName ifIn ifOut ifSpeed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to sort by only interface name then use this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH
     | eval tempField= mvzip(mvzip(mvzip(ifName,ifIn),ifOut),ifSpeed) 
     | stats count by _time tempField
     | eval ifName = mvindex(split(tempField,","),0), ifIn= mvindex(split(tempField,","),1), ifOut=mvindex(split(tempField,","),2), ifSpeed=mvindex(split(tempField,","),2)  
    | sort ifName 
    | table _time ifName ifIn ifOut ifSpeed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 10:00:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429611#M122875</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-05-29T10:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429612#M122876</link>
      <description>&lt;P&gt;This is the way to go! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 10:01:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429612#M122876</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-29T10:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429613#M122877</link>
      <description>&lt;P&gt;oh, y understood wrong my mind because my english is not good. so i mean, listed by order appears interfaces in the log, not sort by interface name. example:&lt;BR /&gt;
I want to be like:&lt;BR /&gt;
Ethernet1/1&lt;BR /&gt;
Ethernet1/2&lt;BR /&gt;
Ethernet1/3&lt;BR /&gt;
Ethernet1/4&lt;BR /&gt;
Ethernet1/5&lt;BR /&gt;
Ethernet1/6&lt;BR /&gt;
Ethernet1/7&lt;BR /&gt;
Ethernet1/8&lt;BR /&gt;
Ethernet1/9&lt;BR /&gt;
Ethernet1/10&lt;BR /&gt;
Ethernet1/11&lt;BR /&gt;
Ethernet1/12 &lt;/P&gt;

&lt;P&gt;Not like this.&lt;BR /&gt;
Ethernet1/1&lt;BR /&gt;
Ethernet1/10&lt;BR /&gt;
Ethernet1/11&lt;BR /&gt;
Ethernet1/12&lt;BR /&gt;
..........&lt;BR /&gt;
Ethernet1/19&lt;BR /&gt;
Ethernet1/2&lt;BR /&gt;
Ethernet1/21&lt;BR /&gt;
Ethernet1/22&lt;BR /&gt;
....vv&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 10:18:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429613#M122877</guid>
      <dc:creator>dailv1808</dc:creator>
      <dc:date>2018-05-29T10:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429614#M122878</link>
      <description>&lt;P&gt;Hi @dailv1808,&lt;/P&gt;

&lt;P&gt;Can you please try this search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH
| eval tempField= mvzip(mvzip(mvzip(ifName,ifIn),ifOut),ifSpeed) 
| stats count by _time tempField
| eval ifName = mvindex(split(tempField,","),0), ifIn= mvindex(split(tempField,","),1), ifOut=mvindex(split(tempField,","),2), ifSpeed=mvindex(split(tempField,","),2)  
|  eval sort_field1 =mvindex(split(ifName,"/"),0), sort_field2 =mvindex(split(ifName,"/"),1)
|  sort str(sort_field1) +num(sort_field2)
| table _time ifName ifIn ifOut ifSpeed
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 11:27:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429614#M122878</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-05-29T11:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429615#M122879</link>
      <description>&lt;P&gt;Thank @kamlesh_vaghela,&lt;BR /&gt;
i tried, now result like this:&lt;BR /&gt;
Ethernet1/1 &lt;BR /&gt;
Ethernet1/1 &lt;BR /&gt;
Ethernet1/1 &lt;BR /&gt;
Ethernet1/1 &lt;BR /&gt;
..........&lt;BR /&gt;
Ok, But this problem is not really too serious. &lt;BR /&gt;
Now i want to calculate bandwidth of each interface use  ifName ifIn ifOut ifSpeed fields. Do you know how to do it? i get snmp log with interval = 1m. &lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 11:35:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429615#M122879</guid>
      <dc:creator>dailv1808</dc:creator>
      <dc:date>2018-05-29T11:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429616#M122880</link>
      <description>&lt;P&gt;Thank so much!&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 11:36:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429616#M122880</guid>
      <dc:creator>dailv1808</dc:creator>
      <dc:date>2018-05-29T11:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429617#M122881</link>
      <description>&lt;P&gt;Ohh,&lt;/P&gt;

&lt;P&gt;just replace &lt;CODE&gt;|  sort str(sort_field1) +num(sort_field2)&lt;/CODE&gt; with &lt;CODE&gt;|  sort _time str(sort_field1) +num(sort_field2)&lt;/CODE&gt;  &lt;/P&gt;

&lt;P&gt;And how you want to show bandwith details of each interface?&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 12:34:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429617#M122881</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-05-29T12:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429618#M122882</link>
      <description>&lt;P&gt;Thank you so much,  i replaced and it work fine.&lt;BR /&gt;
And I want to add new collunm for bandwidth of each interface. like this:&lt;/P&gt;

&lt;P&gt;time | ifName |ifIn |  ifOut  | ifSpeed | bandwidth_in | badwidth_out&lt;BR /&gt;
2018-05-30 08:41:45 | Ethernet1/42 |123434342 |3123  | 100000000| 1212|789&lt;/P&gt;

&lt;P&gt;I refer to this link, &lt;BR /&gt;
&lt;A href="https://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/8141-calculate-bandwidth-snmp.html" target="_blank"&gt;https://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/8141-calculate-bandwidth-snmp.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;How to calculate the formula in splunk?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:43:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429618#M122882</guid>
      <dc:creator>dailv1808</dc:creator>
      <dc:date>2020-09-29T19:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429619#M122883</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;`your search`| table _time ifName ifIn ifOut ifSpeed | mvexpand ifName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Will this help ?&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 04:09:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429619#M122883</guid>
      <dc:creator>CryoHydra</dc:creator>
      <dc:date>2018-05-30T04:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to split events into multiple rows in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429620#M122884</link>
      <description>&lt;P&gt;it just split ifName field, not for ifName ifIn ifOut ifSpeed fields. I use the way of @kamlesh_vaghela and the problem is solved. Anyway, thank your help.&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 06:32:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-events-into-multiple-rows-in-a-table/m-p/429620#M122884</guid>
      <dc:creator>dailv1808</dc:creator>
      <dc:date>2018-05-30T06:32:53Z</dc:date>
    </item>
  </channel>
</rss>

