<?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: Can you help me parse the following raw data set using Splunk? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407657#M72276</link>
    <description>&lt;P&gt;It is a damn ugly log file format to get into Splunk directly as separate events. Would be much easier if you had timestamp on each line and no footer.&lt;/P&gt;

&lt;P&gt;Your best bet now might be to get the whole chunk in as one event and then further extract the contents and split it up with search commands.&lt;/P&gt;

&lt;P&gt;Using Rex to extract the actual data lines into a multi valued field and then split the event into individual events and then for each of those pull out the individual fields of the data.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Oct 2018 14:18:18 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2018-10-05T14:18:18Z</dc:date>
    <item>
      <title>Can you help me parse the following raw data set using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407652#M72271</link>
      <description>&lt;P&gt;I have a raw data set that goes like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Logtime: 20181010_15:30:34

ID: V12

ArrivalTime: 15:30:33
No OFFSET DIRECTION LOAD
1 14.3  Counter 100
2 14.5  Reverse100
ExitTime: 15:30:34
Max: 1000
MIN: 900
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What will be the best way to parse this data using Splunk? &lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 12:58:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407652#M72271</guid>
      <dc:creator>Stevelim</dc:creator>
      <dc:date>2018-10-04T12:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me parse the following raw data set using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407653#M72272</link>
      <description>&lt;P&gt;What is for you, the relevant values?&lt;/P&gt;

&lt;P&gt;you can use the : with separator, but you need modify the file log.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 14:21:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407653#M72272</guid>
      <dc:creator>asabatini85</dc:creator>
      <dc:date>2018-10-04T14:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me parse the following raw data set using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407654#M72273</link>
      <description>&lt;P&gt;And what exactly do you mean by parsing in this case? Timestamping and linebreaking, or field extractions (or both)?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 16:19:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407654#M72273</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-10-04T16:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me parse the following raw data set using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407655#M72274</link>
      <description>&lt;P&gt;My apologies, I realised I did not think deep enough about how it will appear in Splunk since I was originally working on it in Excel. So in Excel, I am able to just fit it columns but I forgot that in Splunk it will be associated with time. My end state is to be able to say do a search and create a time series chart of all the No = 1.&lt;/P&gt;

&lt;P&gt;| No = 1&lt;/P&gt;

&lt;P&gt;and it should return me with something like:&lt;BR /&gt;
15:30:33 OFFSET = 14,3 &amp;lt;- From first log file&lt;BR /&gt;
15:30:33 OFFSET  = 15.2 &amp;lt;- From second log file of similar format&lt;/P&gt;

&lt;P&gt;After which I can then append a | timechart avg(OFFSET) by No to see all the OFFSET.&lt;/P&gt;

&lt;P&gt;I hope it makes sense.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 16:35:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407655#M72274</guid>
      <dc:creator>Stevelim</dc:creator>
      <dc:date>2018-10-04T16:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me parse the following raw data set using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407656#M72275</link>
      <description>&lt;P&gt;I figured what I can extract most of the fields out of the box via Splunk. I will like the key value pair to be something along:&lt;/P&gt;

&lt;P&gt;15:30:33 No1_OFFSET = 14.3&lt;BR /&gt;
15:30:33 No2_OFFSET = 14.5&lt;BR /&gt;
15:30:33 No1_Direction =  Counter&lt;BR /&gt;
15:30:33 No2_Direction = Reverse&lt;/P&gt;

&lt;P&gt;Is this possible?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:30:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407656#M72275</guid>
      <dc:creator>Stevelim</dc:creator>
      <dc:date>2020-09-29T21:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me parse the following raw data set using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407657#M72276</link>
      <description>&lt;P&gt;It is a damn ugly log file format to get into Splunk directly as separate events. Would be much easier if you had timestamp on each line and no footer.&lt;/P&gt;

&lt;P&gt;Your best bet now might be to get the whole chunk in as one event and then further extract the contents and split it up with search commands.&lt;/P&gt;

&lt;P&gt;Using Rex to extract the actual data lines into a multi valued field and then split the event into individual events and then for each of those pull out the individual fields of the data.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 14:18:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407657#M72276</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-10-05T14:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me parse the following raw data set using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407658#M72277</link>
      <description>&lt;P&gt;Yeah, that's one terrible looking log file.  If you have any control over its format, change it to something a bit more splunk-friendly.  If not, then maybe something like this below.  &lt;/P&gt;

&lt;P&gt;I didn't test this at all and I'm sure the regex can be better...the examples is just to provide you an idea of how I'd parse it.&lt;/P&gt;

&lt;P&gt;Essentially, I'd grab the whole thing as one event (at parse time) and then extract the fields i need from each event (at search time).  Of course, if the format changes from event to event or is inconsistent in general, then i would have to modify the extractions appropriately.  &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
# PARSE-TIME SETTINGS
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)(?=Logtime:)
TIME_PREFIX = Logtime:\s*
TIME_FORMAT = %Y%m%d_%H:%M:%S
TIMESTAMP_LOOKAHEAD = 20

# SEARCH-TIME SETTINGS
EXTRACT-arrival_time = (?i)ArrivalTime:\s*(?&amp;lt;arrival_time&amp;gt;\S+)
EXTRACT-exit_time = (?i)ExitTime:\s*(?&amp;lt;exit_time&amp;gt;\S+)
EXTRACT-id = (?i)ID:\s*(?&amp;lt;id&amp;gt;\S+)
EXTRACT-max = (?i)Max:\s*(?&amp;lt;max&amp;gt;\S+)
EXTRACT-min = (?i)Min:\s*(?&amp;lt;min&amp;gt;\S+)
EXTRACT-no1_offset = (?i)^1\s+(?&amp;lt;no1_offset&amp;gt;\S+)\s*(?&amp;lt;no1_direction&amp;gt;counter|reverse)\s*(?&amp;lt;no1_something&amp;gt;\d+)
EXTRACT-no2_offset = (?i)^2\s+(?&amp;lt;no2_offset&amp;gt;\S+)\s*(?&amp;lt;no2_direction&amp;gt;counter|reverse)\s*(?&amp;lt;no2_something&amp;gt;\d+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Oct 2018 16:00:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407658#M72277</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2018-10-07T16:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me parse the following raw data set using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407659#M72278</link>
      <description>&lt;P&gt;This works great! I learnt a lot from the regex pattern as I was primary stuck on how to extract the huge chunk of table. I would love to extract the raw to something splunk friendly but unfortunately that is out of my control.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 05:00:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-parse-the-following-raw-data-set-using-Splunk/m-p/407659#M72278</guid>
      <dc:creator>Stevelim</dc:creator>
      <dc:date>2018-10-08T05:00:58Z</dc:date>
    </item>
  </channel>
</rss>

