<?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 my sample events using regular expression in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348820#M103254</link>
    <description>&lt;P&gt;@prathapkcsc - Just so you know, there is special markup language on this site so certain symbols will transform your post.  If you wrap a word in the asterisk symbol &lt;CODE&gt;*&lt;/CODE&gt; or &lt;CODE&gt;_&lt;/CODE&gt;, without wrapping it in a &lt;CODE&gt;code sample&lt;/CODE&gt;, it will &lt;EM&gt;italicize&lt;/EM&gt; the word. If you wish to show the &lt;CODE&gt;*&lt;/CODE&gt; (i.e. you are displaying sample code or search), simply click on the Code Sample icon to the right of the Blockquote icon in the formatting toolbar. That is how I was able to edit your post so that the &lt;CODE&gt;*&lt;/CODE&gt; will display.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2017 20:26:29 GMT</pubDate>
    <dc:creator>aaraneta_splunk</dc:creator>
    <dc:date>2017-06-16T20:26:29Z</dc:date>
    <item>
      <title>How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348814#M103248</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
i have a sample data file like this, all columns are tab separated&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TYPE                            Category             Count           CPU Usage (%)
Data Node                       Hadoop                26               0.17
Flume                           Hadoop                9                0.2
ResourceManager                 Hadoop                2                0.06
Hadoop                          ZooKeeper             5                0.19
Foyer                           Hadoop                2                0.28
Splunk                          Hadoop                1                0.06
RabbitMQ                        Non-Hadoop            7                0.98
PostGreSQL                      Non-Hadoop            3                0.11
TC_Server                       Non-Hadoop            12               0.67
Edge                            Hadoop                2                0.19
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i want to import this into Splunk and need to split this data.&lt;BR /&gt;
Finally, i need all the values in table format.&lt;BR /&gt;
Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 18:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348814#M103248</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-06-16T18:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348815#M103249</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;how about that&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?:^\s*?)(?&amp;lt;TYPE&amp;gt;[^\t]+)(?:[\t\s]+)(?&amp;lt;Category&amp;gt;[^\t]+)(?:[\t\s]+)(?&amp;lt;Count&amp;gt;[^\t]+)(?:[\t\s]+)(?&amp;lt;CPU_Usage&amp;gt;[^\t]+)(?:[\t\s]+)?
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Jun 2017 19:22:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348815#M103249</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2017-06-16T19:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348816#M103250</link>
      <description>&lt;P&gt;Look at this post&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/1048/how-do-index-tab-delimited-files.html"&gt;https://answers.splunk.com/answers/1048/how-do-index-tab-delimited-files.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 19:30:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348816#M103250</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-16T19:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348817#M103251</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;base search   |  rex " .*?(?:^\s*?)(?[^\t]+)(?:[\t\s]+)(?[^\t]+)(?:[\t\s]+)(?[^\t]+)(?:[\t\s]+)(?[^\t]+)(?:[\t\s]+)? " | table Type,CPU_Usage 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am not getting any data.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 20:15:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348817#M103251</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-06-16T20:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348818#M103252</link>
      <description>&lt;P&gt;Its not working. I changed the files, but no use.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 20:18:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348818#M103252</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-06-16T20:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348819#M103253</link>
      <description>&lt;P&gt;Can you provide me the regular expression?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 20:25:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348819#M103253</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-06-16T20:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348820#M103254</link>
      <description>&lt;P&gt;@prathapkcsc - Just so you know, there is special markup language on this site so certain symbols will transform your post.  If you wrap a word in the asterisk symbol &lt;CODE&gt;*&lt;/CODE&gt; or &lt;CODE&gt;_&lt;/CODE&gt;, without wrapping it in a &lt;CODE&gt;code sample&lt;/CODE&gt;, it will &lt;EM&gt;italicize&lt;/EM&gt; the word. If you wish to show the &lt;CODE&gt;*&lt;/CODE&gt; (i.e. you are displaying sample code or search), simply click on the Code Sample icon to the right of the Blockquote icon in the formatting toolbar. That is how I was able to edit your post so that the &lt;CODE&gt;*&lt;/CODE&gt; will display.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 20:26:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348820#M103254</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-06-16T20:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348821#M103255</link>
      <description>&lt;P&gt;How does your data looks in Splunk? Does all these lines comes as part of single event OR  each line is separate event?&lt;/P&gt;

&lt;P&gt;If it's all coming as single event, you run search like this (will treat the event as table, split into rows with first line as header)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | multikv 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If each line is coming as separate event, then you can do like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "(?&amp;lt;TYPE&amp;gt;.+)\t(?&amp;lt;Category&amp;gt;.+)\t(?&amp;lt;Count&amp;gt;.+)\t(?&amp;lt;CPU_Usage_Perc&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Jun 2017 20:32:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348821#M103255</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-16T20:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348822#M103256</link>
      <description>&lt;P&gt;No, Above data is a single event.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 20:38:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348822#M103256</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-06-16T20:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348823#M103257</link>
      <description>&lt;P&gt;this is the wrong usage of the rex-command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=_raw "(?:^\s*?)(?&amp;lt;TYPE&amp;gt;[^\t]+)(?:[\t\s]+)(?&amp;lt;Category&amp;gt;[^\t]+)(?:[\t\s]+)(?&amp;lt;Count&amp;gt;[^\t]+)(?:[\t\s]+)(?&amp;lt;CPU_Usage&amp;gt;[^\t]+)(?:[\t\s]+)?" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Jun 2017 20:39:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348823#M103257</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2017-06-16T20:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348824#M103258</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; rex field=_raw "(?:^\s*?)(?[^\t]+)(?:[\t\s]+)(?[^\t]+)(?:[\t\s]+)(?[^\t]+)(?:[\t\s]+)(?[^\t]+)(?:[\t\s]+)?" | table TYPE Category 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i tried the above query.&lt;BR /&gt;
The entire data coming only in single row ( in TYPE).&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 21:09:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348824#M103258</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-06-16T21:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348825#M103259</link>
      <description>&lt;P&gt;You need &lt;CODE&gt;multikv&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults
| eval _raw = "TYPE                            Category             Count           CPU Usage (%)
Data Node                       Hadoop                26               0.17
Flume                           Hadoop                9                0.2
ResourceManager                 Hadoop                2                0.06
Hadoop                          ZooKeeper             5                0.19
Foyer                           Hadoop                2                0.28
Splunk                          Hadoop                1                0.06
RabbitMQ                        Non-Hadoop            7                0.98
PostGreSQL                      Non-Hadoop            3                0.11
TC_Server                       Non-Hadoop            12               0.67
Edge                            Hadoop                2                0.19"
| multikv forceheader=1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Jun 2017 21:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348825#M103259</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-16T21:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348826#M103260</link>
      <description>&lt;P&gt;I don't want to hard code the values. Dynamically it has to take the event.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 22:03:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348826#M103260</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-06-16T22:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348827#M103261</link>
      <description>&lt;P&gt;Please can you provide me the solution?&lt;BR /&gt;
I want to avoid that copying data, How do i make it dynamic&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 22:16:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348827#M103261</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-06-16T22:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348828#M103262</link>
      <description>&lt;P&gt;Don't be silly; the hardcoding wasy to show you that &lt;CODE&gt;multikv&lt;/CODE&gt; works.  Just add this to the bottom of your existing search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | mulitkv forceheader=1 | table *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 23:30:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348828#M103262</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-16T23:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to split my sample events using regular expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348829#M103263</link>
      <description>&lt;P&gt;I didn't  understand.&lt;BR /&gt;
Please explain me clearly.&lt;BR /&gt;
Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 23:46:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-my-sample-events-using-regular-expression/m-p/348829#M103263</guid>
      <dc:creator>prathapkcsc</dc:creator>
      <dc:date>2017-06-16T23:46:03Z</dc:date>
    </item>
  </channel>
</rss>

