<?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: Should we perform a field extraction or field transformation on this sample log? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229115#M67857</link>
    <description>&lt;P&gt;NO , we didn't extracted anything, &lt;/P&gt;

&lt;P&gt;Yes we would prefer translated status on field would be great.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sun, 15 Jan 2017 03:49:28 GMT</pubDate>
    <dc:creator>splunker9999</dc:creator>
    <dc:date>2017-01-15T03:49:28Z</dc:date>
    <item>
      <title>Should we perform a field extraction or field transformation on this sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229111#M67853</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We are looking transform fields from log events, can some one please help.&lt;/P&gt;

&lt;P&gt;we need to translate to below codes:&lt;BR /&gt;
I = Upload &lt;BR /&gt;
j = Errored&lt;BR /&gt;
k =  Aborted&lt;BR /&gt;
o =  Successful&lt;BR /&gt;
p =Errored&lt;BR /&gt;
q =  Aborted&lt;/P&gt;

&lt;P&gt;In the below example "i" in bold is where we need to translate.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sat dec 13 10:01:17 2017 0 10.01.42.1 42288 /home/cat/wat/g1/T24_94291_20170113_093008_20161213110014510.txt b s **i** r user 0 *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 18:44:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229111#M67853</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2017-01-13T18:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Should we perform a field extraction or field transformation on this sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229112#M67854</link>
      <description>&lt;P&gt;I would recommend doing a field extraction using regex to capture the i,j,k,o,p and q into a field named code.&lt;/P&gt;

&lt;P&gt;Then in your search use the case command to transform the letter code to the word.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Status_Code=case(code==i,"Upload",code==j,"Errored",code==k,"Aborted" etc..... )
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jan 2017 18:57:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229112#M67854</guid>
      <dc:creator>AnthonyTibaldi</dc:creator>
      <dc:date>2017-01-13T18:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Should we perform a field extraction or field transformation on this sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229113#M67855</link>
      <description>&lt;P&gt;Is the "i" (or any other possible value) already being extracted as field? Do you want to modify raw data (non recommended due to overhead on indexing) or just need a field with translated status.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 19:29:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229113#M67855</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-13T19:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Should we perform a field extraction or field transformation on this sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229114#M67856</link>
      <description>&lt;P&gt;You can create a lookup table for above status abbreviation and status description values table as &lt;STRONG&gt;status_description_csv&lt;/STRONG&gt; lookup definition via csv file.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;status_abbr&lt;/STRONG&gt;,&lt;STRONG&gt;status_description&lt;/STRONG&gt;&lt;BR /&gt;
i,Upload &lt;BR /&gt;
j,Errored&lt;BR /&gt;
k,Aborted&lt;BR /&gt;
o,Successful&lt;BR /&gt;
p,Errored&lt;BR /&gt;
q,Aborted&lt;/P&gt;

&lt;P&gt;You can then use interactive Field Extractor to Extract new fields from the Splunk Search screen (you can either use Regular Expressions or use space as a delimiter)&lt;/P&gt;

&lt;P&gt;For example following is the regular expression for &lt;STRONG&gt;status_abbr&lt;/STRONG&gt; field: ^(?:[^.\n]*.){4}\w+\s+\w+\s+\w+\s+(?P\w+).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;Your Base search&amp;gt; 
| lookup status_description_csv status_abbr output status_description
| table _time status_abbr status_description _raw
| stats count by status_description
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:22:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229114#M67856</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T12:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Should we perform a field extraction or field transformation on this sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229115#M67857</link>
      <description>&lt;P&gt;NO , we didn't extracted anything, &lt;/P&gt;

&lt;P&gt;Yes we would prefer translated status on field would be great.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2017 03:49:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229115#M67857</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2017-01-15T03:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Should we perform a field extraction or field transformation on this sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229116#M67858</link>
      <description>&lt;P&gt;Hi , above regular expression will only work if we 4 ".", but for some of the events we have more "."&lt;BR /&gt;
Below is one of the example, cna you please provide me the regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  sat dec 13 10:01:17 2017 0 10.01.42.1 42288 /home/cat/wat/g1/T24_94291_20170113_093008_20161213110014510.txt.gdp b s **i** r user 0 *

  sat dec 13 10:01:17 2017 0 10.01.42.1 42288 /home/cat/wat.1/g1/T24_94291_20170113_093008_20161213110014510.txt. b s **u** r user 0 *

  sat dec 13 10:01:17 2017 0 10.01.42.1 42288 /home/cat/wat/g1.abc.xls/T24_94291_20170113_093008_20161213110014510.cat b s **o** r user 0 *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Jan 2017 01:09:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229116#M67858</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2017-01-16T01:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Should we perform a field extraction or field transformation on this sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229117#M67859</link>
      <description>&lt;P&gt;Try with this regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(\S+\s+){11}(?&amp;lt;status_abbr&amp;gt;\w)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Jan 2017 01:41:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229117#M67859</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-16T01:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Should we perform a field extraction or field transformation on this sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229118#M67860</link>
      <description>&lt;P&gt;Hi Somesh,&lt;/P&gt;

&lt;P&gt;Just found another isssue, this is picking when we have only 11 spaces , but for few other events it is different.&lt;/P&gt;

&lt;P&gt;here below event has more than 11 spaces, is there a way we can include if it 11 or more spaces some thing using rex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Mon Feb 14 09:35:26 2017 236 100.81.24.1 8189 /cat2/main/y2/jila/itfs/589 y2 jila FS.zip b s o r jila ssh 0 *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Jan 2017 15:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229118#M67860</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2017-01-16T15:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Should we perform a field extraction or field transformation on this sample log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229119#M67861</link>
      <description>&lt;P&gt;Since the nearby words are also single aphabets, it makes it difficult. Also, for other events, the status was 12th from start and 5th from last, but in your new samples it doesn't follow that as well. Assuming the status field can have values from range (I , j, k, o, p, q) and nearby characters don't include any of status values, give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(\S+\s+){11,12}(?&amp;lt;status_abbr&amp;gt;(I|j|k|o|p|q))\s
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Jan 2017 16:02:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Should-we-perform-a-field-extraction-or-field-transformation-on/m-p/229119#M67861</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-16T16:02:23Z</dc:date>
    </item>
  </channel>
</rss>

