<?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 Can I Separate Events Using Search Query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344352#M163159</link>
    <description>&lt;P&gt;Try this run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _time="02/02/2018 12:00:00.000",USER="username admin sample admin1",HOSTNAME="PC-1 PC-2 SERVER_1 SERVER_1" 
| makemv USER 
| makemv HOSTNAME 
| eval data=mvzip(HOSTNAME,USER) 
| mvexpand data 
| table _time data 
| rex field=data "(?&amp;lt;hostname&amp;gt;[^\,]+)\,(?&amp;lt;user&amp;gt;.*)" 
| fields- data
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 02 Feb 2018 08:03:30 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2018-02-02T08:03:30Z</dc:date>
    <item>
      <title>How Can I Separate Events Using Search Query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344344#M163151</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Good Day, I've indexed an event from scripted input but the events are not breaking every line, example logs are in below. How can I expand the event to every line using &lt;STRONG&gt;Splunk Search Query?&lt;/STRONG&gt; Thanks.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Sample event:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   02/02/2018        user, hostname
   12:00:00.000      user1, hostname1
                     user2, hostname2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Expected Output&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;02/02/2018     user, hostname
12:00:00.000

02/02/2018     user1, hostname1
12:00:00.000

02/02/2018     user2, hostname2
12:00:00.000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2018 07:08:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344344#M163151</guid>
      <dc:creator>dantimola</dc:creator>
      <dc:date>2018-02-02T07:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Separate Events Using Search Query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344345#M163152</link>
      <description>&lt;P&gt;@dantimola can you add some sample raw event? Is Time field available for each line you want to break on? Is the following setting enabled for your scripted input sourcetype?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHOULD_LINEMERGE = false
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2018 07:15:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344345#M163152</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-02-02T07:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Separate Events Using Search Query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344346#M163153</link>
      <description>&lt;P&gt;SHOULD_LINEMERGE on props.conf already enabled. Sample raw event is in the "&lt;STRONG&gt;Sample Event:&lt;/STRONG&gt;" found in the question.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 07:27:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344346#M163153</guid>
      <dc:creator>dantimola</dc:creator>
      <dc:date>2018-02-02T07:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Separate Events Using Search Query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344347#M163154</link>
      <description>&lt;P&gt;try this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your_base_search&amp;gt;| eval data=mvzip(user,hostname)
| makemv delim=","
| mvexpand data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 07:31:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344347#M163154</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-02-02T07:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Separate Events Using Search Query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344348#M163155</link>
      <description>&lt;P&gt;This is the closest one I've got, however, it didn't split the event just like the output I wanted but it let me create a new field I need using rex. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;my search here&amp;gt;
| rex mode=sed "s/([\r\n]+)/||/g" 
| makemv _raw delim="||" 
| mvexpand _raw 
| rex (?&amp;lt;user&amp;gt;\w+) 
| rex "||"(?&amp;lt;user&amp;gt;\w+)
| rex ", "(?&amp;lt;hostname&amp;gt;\w+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2018 07:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344348#M163155</guid>
      <dc:creator>dantimola</dc:creator>
      <dc:date>2018-02-02T07:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Separate Events Using Search Query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344349#M163156</link>
      <description>&lt;P&gt;Thank you for your answer, I got the idea but it didn't give me the output I wanted.  &lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 07:42:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344349#M163156</guid>
      <dc:creator>dantimola</dc:creator>
      <dc:date>2018-02-02T07:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Separate Events Using Search Query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344350#M163157</link>
      <description>&lt;P&gt;can you provide some sample events ?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 07:49:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344350#M163157</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-02-02T07:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Separate Events Using Search Query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344351#M163158</link>
      <description>&lt;P&gt;Here's the sample event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;username, PC-1
admin, PC-2
sample, SERVER_1
admin1, SERVER_1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The output I want is this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp  username, PC-1
another timestamp admin, PC-2
.......
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2018 07:56:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344351#M163158</guid>
      <dc:creator>dantimola</dc:creator>
      <dc:date>2018-02-02T07:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I Separate Events Using Search Query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344352#M163159</link>
      <description>&lt;P&gt;Try this run anywhere search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _time="02/02/2018 12:00:00.000",USER="username admin sample admin1",HOSTNAME="PC-1 PC-2 SERVER_1 SERVER_1" 
| makemv USER 
| makemv HOSTNAME 
| eval data=mvzip(HOSTNAME,USER) 
| mvexpand data 
| table _time data 
| rex field=data "(?&amp;lt;hostname&amp;gt;[^\,]+)\,(?&amp;lt;user&amp;gt;.*)" 
| fields- data
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2018 08:03:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-Separate-Events-Using-Search-Query/m-p/344352#M163159</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-02-02T08:03:30Z</dc:date>
    </item>
  </channel>
</rss>

