<?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: Multi key value combinations in a single line in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multi-key-value-combinations-in-a-single-line/m-p/183196#M52747</link>
    <description>&lt;P&gt;Thanks for taking the time to answer! Your regex is certainly better, but the output I get is not what I'm looking for. I now get: ET, LSID, SEID and all and Statuses for all SEID's at that time.&lt;BR /&gt;
With your solution I appear to lose the relation ET&amp;lt;-&amp;gt;LSID&amp;lt;-&amp;gt;SEID&amp;lt;-&amp;gt;Status and that's what I need: the status of an SEID at a certain time.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Mar 2014 15:50:41 GMT</pubDate>
    <dc:creator>tonniea</dc:creator>
    <dc:date>2014-03-12T15:50:41Z</dc:date>
    <item>
      <title>Multi key value combinations in a single line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multi-key-value-combinations-in-a-single-line/m-p/183194#M52745</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I'm trying to perform some field extractions in a log containing availability reports of segments in our system similar to the one below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;SSEL&amp;gt;&amp;lt;ET&amp;gt;2011-07-02T12:11:29.676Z&amp;lt;/ET&amp;gt;&amp;lt;LSID&amp;gt;12000&amp;lt;/LSID&amp;gt;&amp;lt;SEID&amp;gt;1007&amp;lt;/SEID&amp;gt;&amp;lt;S&amp;gt;OUT-OF-SERVICE&amp;lt;/S&amp;gt;&amp;lt;LSID&amp;gt;12000&amp;lt;/LSID&amp;gt;&amp;lt;SEID&amp;gt;1010&amp;lt;/SEID&amp;gt;&amp;lt;S&amp;gt;OUT-OF-SERVICE&amp;lt;/S&amp;gt;&amp;lt;/SSEL&amp;gt;
etc. followed by from 10 up to 200 combinations of &amp;lt;LSID&amp;gt;&amp;lt;SEID&amp;gt;&amp;lt;S&amp;gt; tags and ending in &amp;lt;/SSEL&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The syntax of the logline is like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;DateTime&amp;gt;&amp;lt;Logical ID&amp;gt;&amp;lt;Segment ID&amp;gt;&amp;lt;Status&amp;gt;....&amp;lt;Logical ID&amp;gt;&amp;lt;Segment ID&amp;gt;&amp;lt;Status&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In human language: per logline we have 1 datetime and multiple status reports for parts of the system identified by &lt;CODE&gt;&amp;lt;Logical ID&amp;gt;&amp;lt;Segment ID&amp;gt;&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I'm looking to extract the combinations of LSID, SEID and S and have each combination extracted with the EventTime (&lt;ET&gt;) that is present at the start &lt;BR /&gt;
of the logline. The goal is to create an overview of the status (S) for combinations of LSID,SEID during the day.&lt;/ET&gt;&lt;/P&gt;

&lt;P&gt;I've tried multi-value extraction using props.conf and transforms.conf like below but that fails for 2 reasons:&lt;BR /&gt;
- the time is only found once in the logline&lt;BR /&gt;
- the relation between LSID, SEID and S is broken as Splunk extracts all LSID's in the logline individually. Same for all SEID's and all S's.&lt;/P&gt;

&lt;P&gt;My props.conf and transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[OL]
pulldown_type = 1
REPORT-r1 = ol_logfile

[ol_logfile]
REGEX=(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}\.\d{3})(.*?)&amp;lt;LSID&amp;gt;(\d*?)\&amp;lt;/LSID&amp;gt;.*?&amp;lt;SID&amp;gt;(\d*?)\&amp;lt;/SID&amp;gt;.*?&amp;lt;S&amp;gt;(.*?)\&amp;lt;/S&amp;gt;
FORMAT=date::$1,time::$2,garbage::$3,LSID::$4,SEID::$5,S::$6
MV_ADD=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm thinking now of writing a Python preprocessor to deliver the logline to Splunk like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;ET&amp;gt;2011-07-02T12:11:29.676Z&amp;lt;/ET&amp;gt;&amp;lt;LSID&amp;gt;12000&amp;lt;/LSID&amp;gt;&amp;lt;SEID&amp;gt;1007&amp;lt;/SEID&amp;gt;&amp;lt;S&amp;gt;OUT-OF-SERVICE&amp;lt;/S&amp;gt;
&amp;lt;ET&amp;gt;2011-07-02T12:11:29.676Z&amp;lt;/ET&amp;gt;&amp;lt;LSID&amp;gt;12000&amp;lt;/LSID&amp;gt;&amp;lt;SEID&amp;gt;1010&amp;lt;/SEID&amp;gt;&amp;lt;S&amp;gt;OUT-OF-SERVICE&amp;lt;/S&amp;gt;
....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I'd rather use built-in Splunk routines as the preprocessor adds complexity and maintenance.&lt;/P&gt;

&lt;P&gt;What would be the most Splunkish way to import the data in Splunk for my report? I'm not happy with the preprocessor, but I also don't see how to extract &lt;BR /&gt;
the multivalue part. &lt;/P&gt;

&lt;P&gt;Any hints are greatly appreciated, thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 06:37:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multi-key-value-combinations-in-a-single-line/m-p/183194#M52745</guid>
      <dc:creator>tonniea</dc:creator>
      <dc:date>2014-03-12T06:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Multi key value combinations in a single line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multi-key-value-combinations-in-a-single-line/m-p/183195#M52746</link>
      <description>&lt;P&gt;Hi tonniea,&lt;/P&gt;

&lt;P&gt;You can use the below query to get wat u want . change the index and sourtype accordingly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="indexname" sourcetype="samplename" | rex "ET&amp;gt;(?&amp;lt;ET&amp;gt;[^&amp;lt;]*)\&amp;lt;" | rex max_match=100  "LSID&amp;gt;(?&amp;lt;LSID&amp;gt;[^&amp;lt;]*)\&amp;lt;" | rex max_match=100  "SEID&amp;gt;(?&amp;lt;SEID&amp;gt;[^&amp;lt;]*)\&amp;lt;" | rex max_match=100  "S&amp;gt;(?&amp;lt;S&amp;gt;[^&amp;lt;]*)\&amp;lt;" | stats values(LSID) as LSID values(SEID) as SEID values(S) as S by ET
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i am assuming 100 value per Event Time , you can configure to any no based on ur need.&lt;/P&gt;

&lt;P&gt;Hope this Helps !&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 07:27:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multi-key-value-combinations-in-a-single-line/m-p/183195#M52746</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2014-03-12T07:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Multi key value combinations in a single line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multi-key-value-combinations-in-a-single-line/m-p/183196#M52747</link>
      <description>&lt;P&gt;Thanks for taking the time to answer! Your regex is certainly better, but the output I get is not what I'm looking for. I now get: ET, LSID, SEID and all and Statuses for all SEID's at that time.&lt;BR /&gt;
With your solution I appear to lose the relation ET&amp;lt;-&amp;gt;LSID&amp;lt;-&amp;gt;SEID&amp;lt;-&amp;gt;Status and that's what I need: the status of an SEID at a certain time.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 15:50:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multi-key-value-combinations-in-a-single-line/m-p/183196#M52747</guid>
      <dc:creator>tonniea</dc:creator>
      <dc:date>2014-03-12T15:50:41Z</dc:date>
    </item>
  </channel>
</rss>

