<?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: Extracting multiple fields from events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316659#M94743</link>
    <description>&lt;P&gt;I want to display them by status "in-progress" and "Completed"&lt;/P&gt;</description>
    <pubDate>Mon, 04 Sep 2017 02:14:44 GMT</pubDate>
    <dc:creator>bharpur183</dc:creator>
    <dc:date>2017-09-04T02:14:44Z</dc:date>
    <item>
      <title>Extracting multiple fields from events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316652#M94736</link>
      <description>&lt;P&gt;I want to extract 2 separate fields from the below events :&lt;/P&gt;

&lt;P&gt;the event is :&lt;/P&gt;

&lt;P&gt;2017-09-01T23:50:49.325-04:00 INFO m_gchgserv_gchg.cpp(2264)[8] GCHG::sendGchgUpdate() - 808998798 type: 0 note: &lt;BR /&gt;
Completed {FIFW GCHG 12345}: NETS: TOY-HK1 relocate PCCW 10G circuit from jr4 to jrf3 (Physical work)&lt;BR /&gt;
  Scheduled            : 09/02/2017 03:08 GMT to 09/02/2017 03:50 GMT&lt;BR /&gt;
  Rep                        : EDDIE CHOY&lt;BR /&gt;
  Approver             : HIDETOSHI NAGAO&lt;BR /&gt;
  Note: Work will be swung from jrf4 to jrf3 for diversity purpose.&lt;/P&gt;

&lt;P&gt;From the event I want to extract the ticket #&lt;BR /&gt;
 which in this case is {FIFW GCHG 12345}: &lt;BR /&gt;
and then the Note&lt;BR /&gt;
 which is   Note: Work will be swung from jrf4 to jrf3 for diversity purpose. &lt;/P&gt;

&lt;P&gt;The thing is both these fields keep changing from time to time. Ticket # changes and work description changes as well.&lt;BR /&gt;
But I want the regex in a way that whatever is put under those 2 fields shows up in a dashboard &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:36:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316652#M94736</guid>
      <dc:creator>bharpur183</dc:creator>
      <dc:date>2020-09-29T15:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multiple fields from events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316653#M94737</link>
      <description>&lt;P&gt;You haven't said if you want this for using in a search, or in a props.conf, so I'm going to assume the former, but the regex can be applied to the latter as well.&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "(?P&amp;lt;case&amp;gt;{[^}]+})[\s\S]+(?P&amp;lt;note&amp;gt;Note:.*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Sep 2017 00:13:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316653#M94737</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-09-04T00:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multiple fields from events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316654#M94738</link>
      <description>&lt;P&gt;Thanks @cpetterborg . the above worked but only getting the ticket or case number  the note description or regex did extract anything &lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 00:25:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316654#M94738</guid>
      <dc:creator>bharpur183</dc:creator>
      <dc:date>2017-09-04T00:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multiple fields from events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316655#M94739</link>
      <description>&lt;P&gt;my bad , I missed it . I can see the note now.&lt;/P&gt;

&lt;P&gt;One more thing in the above I have another section that says status , which shows if the case or ticket is in progress or completed.&lt;/P&gt;

&lt;P&gt;1 . How can I sort them to show the in progress on the and the completed after that?&lt;BR /&gt;
2.  Is it possible to color code the in-progress and completed events ?&lt;/P&gt;

&lt;P&gt;the entire search string is :&lt;/P&gt;

&lt;P&gt;(index=guts* contextName::gchg) AND (Completed AND NOTE) sourcetype=gchgserv source="/bb/intntwk/logs/gchgserv.log.20170901" contextName=gchg Status="&lt;EM&gt;"  | iconify Status  | rex "(?P{[^}]+})[\s\S]+(?PNote:.&lt;/EM&gt;)"| table Ticket,Status,note&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 00:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316655#M94739</guid>
      <dc:creator>bharpur183</dc:creator>
      <dc:date>2017-09-04T00:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multiple fields from events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316656#M94740</link>
      <description>&lt;P&gt;Can you give an example of the event that has "status" in it?&lt;/P&gt;

&lt;P&gt;Does it have the case number in that event as well?&lt;/P&gt;

&lt;P&gt;Regarding your questions:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;If you sort by time, it should have the last one that is the current status, but it may depend on what you data looks like to see what needs to be done. Example data is helpful.&lt;/LI&gt;
&lt;LI&gt;Yes, you can color code things, and this is a case that you can color code. It is a bit more complicated thing to do, but let's see what your additional example data gives us.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 04 Sep 2017 01:30:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316656#M94740</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-09-04T01:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multiple fields from events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316657#M94741</link>
      <description>&lt;P&gt;Yea. I was able to sort it based on time.&lt;BR /&gt;
If color coding is possible that will be great&lt;/P&gt;

&lt;P&gt;the event is :&lt;/P&gt;

&lt;P&gt;2017-09-01T23:50:49.325-04:00 INFO m_gchgserv_gchg.cpp(2264)[8] GCHG::sendGchgUpdate() - 808998798 type: 0 note: &lt;BR /&gt;
Completed {FIFW GCHG 12345}: NETS: TOY-HK1 relocate PCCW 10G circuit from jr4 to jrf3 (Physical work)&lt;BR /&gt;
 Scheduled : 09/02/2017 03:08 GMT to 09/02/2017 03:50 GMT&lt;BR /&gt;
 Rep           : Ray Choy&lt;BR /&gt;
 Approver : Chig Chiot&lt;BR /&gt;
 Note: Work will be swung from jrf4 to jrf3 for diversity purpose.&lt;/P&gt;

&lt;P&gt;So in the above :&lt;BR /&gt;
 where it says Completed, that the status &lt;BR /&gt;
The case # is {fifw gchg 12345} &lt;/P&gt;

&lt;P&gt;The status changes from in-progress to completed. so want to code code them separately &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:36:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316657#M94741</guid>
      <dc:creator>bharpur183</dc:creator>
      <dc:date>2020-09-29T15:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multiple fields from events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316658#M94742</link>
      <description>&lt;P&gt;So assuming that the progress comes just before the case number:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "(?P&amp;lt;status&amp;gt;.*)\s(?P&amp;lt;case&amp;gt;{[^}]+})[\s\S]+(?P&amp;lt;note&amp;gt;Note:.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, if all the related events have the case number, you can group them into a single even to look at with the &lt;CODE&gt;transaction&lt;/CODE&gt; command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "(?P&amp;lt;status&amp;gt;.*)\s(?P&amp;lt;case&amp;gt;{[^}]+})[\s\S]+(?P&amp;lt;note&amp;gt;Note:.*)" | transaction case
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure if it will help what you want, but that will group everything by case. If you are only wanting to get the most recent value to see the &lt;CODE&gt;status&lt;/CODE&gt;, use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "(?P&amp;lt;status&amp;gt;.*)\s(?P&amp;lt;case&amp;gt;{[^}]+})[\s\S]+(?P&amp;lt;note&amp;gt;Note:.*)" | stats latest status by case
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then the color coding is dependent on how you want to display the data and what the possible values are, for example, if there are more than just &lt;CODE&gt;in progress&lt;/CODE&gt; and &lt;CODE&gt;completed&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 02:04:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316658#M94742</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-09-04T02:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multiple fields from events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316659#M94743</link>
      <description>&lt;P&gt;I want to display them by status "in-progress" and "Completed"&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 02:14:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316659#M94743</guid>
      <dc:creator>bharpur183</dc:creator>
      <dc:date>2017-09-04T02:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multiple fields from events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316660#M94744</link>
      <description>&lt;P&gt;Coloring the cells of a table is beyond the scope of the question you originally asked, but here is a link to documentation that should be of help:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Viz/TableFormatsXML"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Viz/TableFormatsXML&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you are going to color code the &lt;CODE&gt;status&lt;/CODE&gt; of the cases, the &lt;CODE&gt;note&lt;/CODE&gt; is useless unless it is exactly the same for all the instances of the &lt;CODE&gt;case&lt;/CODE&gt; throughout the events. &lt;STRONG&gt;If&lt;/STRONG&gt; the &lt;CODE&gt;note&lt;/CODE&gt; will be the same, then you can use a the &lt;CODE&gt;stats&lt;/CODE&gt; command slightly differently:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | rex "(?P&amp;lt;status&amp;gt;.*)\s(?P&amp;lt;case&amp;gt;{[^}]+})[\s\S]+(?P&amp;lt;note&amp;gt;Note:.*)" | stats latest status by case, note | sort status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need further help with the color coding of the event data, submit a &lt;STRONG&gt;&lt;EM&gt;new question&lt;/EM&gt;&lt;/STRONG&gt; here in &lt;STRONG&gt;Answers&lt;/STRONG&gt; to address it. Please be specific in what you want to display and how to display if it you do. Also it's good to mention the version of Splunk you are using, especially if it isn't a very recent version.&lt;/P&gt;

&lt;P&gt;If I've answered your question here, please accept the answer so that others finding this question will know that it was answered successfully.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 12:47:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-events/m-p/316660#M94744</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-09-04T12:47:05Z</dc:date>
    </item>
  </channel>
</rss>

