<?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 edit my search to create a table with multiple lines per single event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263681#M79139</link>
    <description>&lt;P&gt;Can you provide an example of what you're looking for?&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2017 18:24:38 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2017-01-30T18:24:38Z</dc:date>
    <item>
      <title>How to edit my search to create a table with multiple lines per single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263676#M79134</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;having JSON formatted events there are parts of the event with the same key like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   events: [    [-] 
     {  [-] 
       classifications: [   [+] 
       ]    
       data: {  [-] 
         rewrite_sql: select * from users where username='ZAP' UNION ALL select NULL -- ' and password='ZAP';   
         rewrite_with_sql: SELECT NULL LIMIT 0; 
       }    
       stack: [ [-] 
       ]    
       type: Rewrite    
     }  
     {  [-] 
       classifications: [   [+] 
       ]    
       data: {  [-] 
         corpusType: SQL    
         infected: select * from users where username='ZAP' UNION ALL select NULL -- ' and password='ZAP';  
         injectedPart: ZAP' UNION ALL select NULL -- 
       }    
       stack: [ [-] 
       ]    
       type: Injection  
     }  
   ]    
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My search looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="rasp logs" | spath | rename events{}.type as "Event_Type", events{}.data.corpusType as "Attack_Type", id as "Event ID" | eval x=mvzip(Event_Type,Attack_Type) | mvexpand x | eval x = split(x,",") | eval RASP_Event_Action=mvindex(x,0) | eval Event_Type=mvindex(x,1) | table "Event ID", "Event_Type", RASP_Event_Action
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but my table looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;c58b842a-2b70-4077-a7fa-e2e4bdb04688        SQL     Rewrite
c58b842a-2b70-4077-a7fa-e2e4bdb04688

c58b842a-2b70-4077-a7fa-e2e4bdb04688        SQL     Injection
c58b842a-2b70-4077-a7fa-e2e4bdb04688
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to have my table formatted like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;c58b842a-2b70-4077-a7fa-e2e4bdb04688         SQL    Injection
.............................................SQL    Rewrite (dots only to make the display correct)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;happy to get any idea to move to the right direction&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 09:39:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263676#M79134</guid>
      <dc:creator>julz0815</dc:creator>
      <dc:date>2017-01-30T09:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a table with multiple lines per single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263677#M79135</link>
      <description>&lt;P&gt;Can you try this please?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="rasp logs" 
| spath 
| rename events{}.type as "Event_Type", events{}.data.corpusType as "Attack_Type"
| eval x=mvzip(Event_Type,Attack_Type) 
| eval z=mvzip(x,id)
| mvexpand z 
| eval z = split(z,",") 
| eval Event_Action=mvindex(z,0) 
| eval Event_Type=mvindex(z,1)
| eval Event_ID=mvindex(z,2)
| table Event_ID, Event_Type, Event_Action
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Jan 2017 14:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263677#M79135</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-01-30T14:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a table with multiple lines per single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263678#M79136</link>
      <description>&lt;P&gt;not 100% but a very good start - THX!&lt;/P&gt;

&lt;P&gt;my Event ID is not only displayed once, but for the second line of the same event id I don't need it at all. not sure this is working at all?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 14:17:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263678#M79136</guid>
      <dc:creator>julz0815</dc:creator>
      <dc:date>2017-01-30T14:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a table with multiple lines per single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263679#M79137</link>
      <description>&lt;P&gt;Oh i see what you mean now.  You need something to thread the event id together...  see if this works&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="rasp logs" 
 | spath 
 | rename events{}.type as "Event_Type", events{}.data.corpusType as "Attack_Type"
 | eval x=mvzip(Event_Type,Attack_Type) 
 | eval z=mvzip(x,id)
 | mvexpand z 
 | eval z = split(z,",") 
 | eval Event_Action=mvindex(z,0) 
 | eval Event_Type=mvindex(z,1)
 | eval Event_ID=mvindex(z,2)
 | transaction Event_ID
 | chart  values(Event_Type), values(Event_Action) by Event_ID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Jan 2017 14:29:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263679#M79137</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-01-30T14:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a table with multiple lines per single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263680#M79138</link>
      <description>&lt;P&gt;wow, great! thanks a lot!&lt;/P&gt;

&lt;P&gt;one last question: if the event part now is somehow dynamic and there can be n events. Can the display/search made dynamic as well? I mean now I ask for the different elements on their own like z,0 z,1 and z,2. Can there be some sort of loop to do so?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 14:49:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263680#M79138</guid>
      <dc:creator>julz0815</dc:creator>
      <dc:date>2017-01-30T14:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to create a table with multiple lines per single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263681#M79139</link>
      <description>&lt;P&gt;Can you provide an example of what you're looking for?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 18:24:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-create-a-table-with-multiple-lines-per/m-p/263681#M79139</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-01-30T18:24:38Z</dc:date>
    </item>
  </channel>
</rss>

