<?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: Combine multiple events into a single row in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436346#M7850</link>
    <description>&lt;P&gt;Hi Jeevan,&lt;BR /&gt;
Pls provide us more info.. &lt;BR /&gt;
is the logs loaded to splunk already? &lt;BR /&gt;
do you want to combine multiple events into single row - before indexing or after indexing(just you want to query and see the results as a single row)?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Oct 2018 12:23:11 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2018-10-17T12:23:11Z</dc:date>
    <item>
      <title>Combine multiple events into a single row</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436344#M7848</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;

&lt;P&gt;Please could you help me with this.  We are planning to setup our environment like a file transfer information will be logged at each stage.  Usually any file transfer will have multiple stages in our environment and transfer can fail at any stage.  If it fails, further or next stages wont occur and their events wont get generated.  so I want to display each transfer status in a single line like source details, file name, filesize, transfer start time, transfer end time, target details, target server, path etc.  this can only be acquired from multiple events.  Please advise how can I combine multiple events into a single one.&lt;/P&gt;

&lt;P&gt;thanks,&lt;BR /&gt;
Uday&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 07:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436344#M7848</guid>
      <dc:creator>jeevankumarg</dc:creator>
      <dc:date>2018-10-17T07:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple events into a single row</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436345#M7849</link>
      <description>&lt;P&gt;Hi, assuming file name field is extracted, you can group events by "filename" field using &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.0/SearchReference/Transaction"&gt;transaction&lt;/A&gt; command. Have a look at docs and see if it meets your requirement. &lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 12:04:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436345#M7849</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-10-17T12:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple events into a single row</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436346#M7850</link>
      <description>&lt;P&gt;Hi Jeevan,&lt;BR /&gt;
Pls provide us more info.. &lt;BR /&gt;
is the logs loaded to splunk already? &lt;BR /&gt;
do you want to combine multiple events into single row - before indexing or after indexing(just you want to query and see the results as a single row)?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 12:23:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436346#M7850</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2018-10-17T12:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple events into a single row</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436347#M7851</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Yes.  We have already loaded the logs/events to Splunk.  Now our requirement is to intelligently show each transfer in a single row.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 12:33:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436347#M7851</guid>
      <dc:creator>jeevankumarg</dc:creator>
      <dc:date>2018-10-17T12:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple events into a single row</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436348#M7852</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Yes.  I tried grouping them using Filename and other fields but it is still returning many rows.  Also its showing different field values in the same field one by one.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 12:42:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436348#M7852</guid>
      <dc:creator>jeevankumarg</dc:creator>
      <dc:date>2018-10-17T12:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple events into a single row</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436349#M7853</link>
      <description>&lt;P&gt;Can you provide some sample events and let us know your expected output.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 12:48:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436349#M7853</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-10-17T12:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple events into a single row</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436350#M7854</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Please could you check the image at the below location:&lt;BR /&gt;
&lt;A href="https://i.postimg.cc/9FVQ5fhw/Capture.jpg"&gt;https://i.postimg.cc/9FVQ5fhw/Capture.jpg&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It has sample data along with expected output. &lt;BR /&gt;
Many thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 13:27:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436350#M7854</guid>
      <dc:creator>jeevankumarg</dc:creator>
      <dc:date>2018-10-17T13:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple events into a single row</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436351#M7855</link>
      <description>&lt;P&gt;Hi jeevankumarg,&lt;/P&gt;

&lt;P&gt;As was already suggested, I think you need to start from combining the data using the &lt;CODE&gt;transaction&lt;/CODE&gt; command. I had a look at your picture, but it wasn't entirely clear what sort of data you already have in your index. I'm assuming that you already have the data in the top of your picture?&lt;/P&gt;

&lt;P&gt;So, I suppose you could go along with something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| transaction SrcFileName TgtFileName
|eval LastStatus=mvindex(Status,-1)
|eval LastEndDateTime=mvindex(EndDateTime,-1)
|eval LastExecutionStep=mvindex(ExecutionStep,-1)
|eval LastDestinationServer=mvindex(DestinationServer,-1)
|rename LastStatus as Status
|rename LasteEndDateTime as EndDateTime
|rename LastExecutionStep as ExeceutionStep
|rename LastDestinationServer as DestinationServer
|table BusinessObject, SrcFileName, SourceServer, DestinationServer, Environment, ExecutionStep, Status, TgtFileName, StartDateTime, EndDateTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The idea here is that within the transaction, the eval-command &lt;CODE&gt;mvindex&lt;/CODE&gt; gets you the last value for that particular field, as &lt;CODE&gt;transaction&lt;/CODE&gt; creates a multi-value field for fields that do not have identical values across the transaction. (If there is only one value, the field will not be multi-value, unless you give the option &lt;CODE&gt;mvlist=true&lt;/CODE&gt; to &lt;CODE&gt;transaction&lt;/CODE&gt;.)&lt;/P&gt;

&lt;P&gt;Hope this helps you or at least gives you some idea for a solution.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 11:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436351#M7855</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2018-10-22T11:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple events into a single row</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436352#M7856</link>
      <description>&lt;P&gt;Without seeing the raw source data in Splunk, the data presented in the image link provided (&lt;A href="https://postimg.cc/grSW3mrG"&gt;https://postimg.cc/grSW3mrG&lt;/A&gt;) reveals that there is insufficient information to reliably bring your events together.  Even if source and destination files were used (similar source and file names in distinct transfers would mess with that method for grouping the transfers), the events do not hold the target filename constant throughout the transfer.  Thus we must filter the ones out which are not constant.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where SrcFileName!=TgtFileName OR Status=ERROR | stats last(Status) AS status by SrcFileName TgtFileName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;from there you just add to the stats the other fields of interest using the same last command seen above on Status with the rest of the fields: BusinessObject, SrcFileName, SourceServer, DestinationServer, Environment, ExecutionStep, Status, TgtFileName, StartDateTime, EndDateTime&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 12:34:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Combine-multiple-events-into-a-single-row/m-p/436352#M7856</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2018-10-22T12:34:19Z</dc:date>
    </item>
  </channel>
</rss>

