<?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 Splitting output and field extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38154#M8651</link>
    <description>&lt;P&gt;I'm using Subsystem Device Drivers (SDD) on an AIX system to monitor SAN LUNs. When I run "datapath query devstats" command, I get output that looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Device #:  35
=============
                Total Read  Total Write  Active Read  Active Write   Maximum
I/O:             301295802      7081834            0             0        40
SECTOR:          967435533   1003883755            0             0     11424
Transfer Size:      &amp;lt;= 512        &amp;lt;= 4k       &amp;lt;= 16K        &amp;lt;= 64K     &amp;gt; 64K
                     13566        32412    301058990       4143978   3128690
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(The spacing isn't coming out correctly on this form, but you get the idea). &lt;/P&gt;

&lt;P&gt;It lists X number of the above depending on how many LUNs I have assigned. In this case, there will be 36 entries (0-35, #35 being the one I just pasted). &lt;/P&gt;

&lt;P&gt;What I need is to capture the device IDs as well as "Total Read" and "Total Write" fields for both I/O and SECTOR for each device. &lt;/P&gt;

&lt;P&gt;This command would be running every hour, its output sent directly to Splunk. &lt;/P&gt;

&lt;P&gt;The trick here will be telling Splunk to split the output up per Device, and then extracting the needed fields across multiple lines.&lt;/P&gt;

&lt;P&gt;Is this possible? If so, how do I tell Splunk to break the output up into chunks divided in a certain spot? &lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 27 Aug 2010 01:49:16 GMT</pubDate>
    <dc:creator>Branden</dc:creator>
    <dc:date>2010-08-27T01:49:16Z</dc:date>
    <item>
      <title>Splitting output and field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38154#M8651</link>
      <description>&lt;P&gt;I'm using Subsystem Device Drivers (SDD) on an AIX system to monitor SAN LUNs. When I run "datapath query devstats" command, I get output that looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Device #:  35
=============
                Total Read  Total Write  Active Read  Active Write   Maximum
I/O:             301295802      7081834            0             0        40
SECTOR:          967435533   1003883755            0             0     11424
Transfer Size:      &amp;lt;= 512        &amp;lt;= 4k       &amp;lt;= 16K        &amp;lt;= 64K     &amp;gt; 64K
                     13566        32412    301058990       4143978   3128690
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(The spacing isn't coming out correctly on this form, but you get the idea). &lt;/P&gt;

&lt;P&gt;It lists X number of the above depending on how many LUNs I have assigned. In this case, there will be 36 entries (0-35, #35 being the one I just pasted). &lt;/P&gt;

&lt;P&gt;What I need is to capture the device IDs as well as "Total Read" and "Total Write" fields for both I/O and SECTOR for each device. &lt;/P&gt;

&lt;P&gt;This command would be running every hour, its output sent directly to Splunk. &lt;/P&gt;

&lt;P&gt;The trick here will be telling Splunk to split the output up per Device, and then extracting the needed fields across multiple lines.&lt;/P&gt;

&lt;P&gt;Is this possible? If so, how do I tell Splunk to break the output up into chunks divided in a certain spot? &lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2010 01:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38154#M8651</guid>
      <dc:creator>Branden</dc:creator>
      <dc:date>2010-08-27T01:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting output and field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38155#M8652</link>
      <description>&lt;P&gt;Thanks for the edit, looks great!&lt;BR /&gt;
One thing for people to note: the "Device #: 35" and the equal signs below it are part of the output as well.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2010 02:14:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38155#M8652</guid>
      <dc:creator>Branden</dc:creator>
      <dc:date>2010-08-27T02:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting output and field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38156#M8653</link>
      <description>&lt;P&gt;I'd modify the linebreak to include the whole event.&lt;/P&gt;

&lt;P&gt;In addition, I was able to extract to fields using something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|file /tmp/test.txt | rex field=_raw "Device #:\s+(?P&amp;lt;device_id&amp;gt;[\d]+)" | rex field=_raw "I\/O:\s+(?P&amp;lt;total_read_io&amp;gt;[\d]+)\s+(?P&amp;lt;total_write_io&amp;gt;[\d]+)\s+" | rex field=_raw "SECTOR:\s+(?P&amp;lt;sector_write_io&amp;gt;[\d]+)\s+(?P&amp;lt;sector_read_io&amp;gt;[\d]+)\s+"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Brian&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2010 02:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38156#M8653</guid>
      <dc:creator>Brian_Osburn</dc:creator>
      <dc:date>2010-08-27T02:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting output and field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38157#M8654</link>
      <description>&lt;P&gt;Brian,&lt;/P&gt;

&lt;P&gt;Thank you for your comment.&lt;BR /&gt;
   How do I go about modifying the link break to include the whole event? Can you provide some clarification on that? &lt;BR /&gt;
   Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2010 02:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38157#M8654</guid>
      <dc:creator>Branden</dc:creator>
      <dc:date>2010-08-27T02:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting output and field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38158#M8655</link>
      <description>&lt;P&gt;You can change how events are broken up (on input, so you may need to reindex data until it's right) using the BREAK_ONLY_BEFORE parameter in props.conf. That's probably the easiest way to configure it, something like &lt;CODE&gt;BREAK_ONLY_BEFORE = ^Device #: \d+&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:16:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splitting-output-and-field-extraction/m-p/38158#M8655</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2020-09-28T09:16:47Z</dc:date>
    </item>
  </channel>
</rss>

