<?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: Filed extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684848#M233745</link>
    <description>&lt;P&gt;If your data is always in the same order, as others already suggested, it's just matter of setting up either regex-based or delimiter-based extraction to find a value in given position.&lt;/P&gt;&lt;P&gt;But if the problem lies in the fact that column order can change (and is always determined by a header row in a file), only INDEXED_EXTRACTIONS can help because Splunk processes each event separately so it has no way of knowing which "format" particular row belongs go if different files had different header rows.&lt;/P&gt;</description>
    <pubDate>Sat, 20 Apr 2024 06:12:47 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-04-20T06:12:47Z</dc:date>
    <item>
      <title>Filed extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684615#M233686</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;I have a question about regex and extraction&lt;/P&gt;&lt;P&gt;I have _raw data in 2 rows/lines&amp;nbsp; (key and value) and I have to extract filed with key and value&lt;BR /&gt;&lt;BR /&gt;e.g :&amp;nbsp;&lt;BR /&gt;row 1 : Test1 Test2 Test3&amp;nbsp;Test4&amp;nbsp;Test5&amp;nbsp;Test6&amp;nbsp;&lt;STRONG&gt;Test7&lt;/STRONG&gt;&amp;nbsp;Test8&amp;nbsp;Test9&amp;nbsp;Test10&lt;BR /&gt;row 2:&amp;nbsp; 101&amp;nbsp; &amp;nbsp;&amp;nbsp;102&amp;nbsp; &amp;nbsp; &amp;nbsp;103.&amp;nbsp; &amp;nbsp; 104.&amp;nbsp; &amp;nbsp; &amp;nbsp;105.&amp;nbsp; &amp;nbsp;106.&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;107.&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;108.&amp;nbsp; &amp;nbsp;109.&amp;nbsp; &amp;nbsp; 110&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have to extract only &lt;STRONG&gt;Test7&lt;/STRONG&gt; from above log and have print it's value in table&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Pls help me&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Moin&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 10:08:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684615#M233686</guid>
      <dc:creator>moinoddinyadgir</dc:creator>
      <dc:date>2024-04-18T10:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filed extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684621#M233691</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;try using kvform (&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/9.1.2312/SearchReference/Kvform" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/9.1.2312/SearchReference/Kvform&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 11:09:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684621#M233691</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-04-18T11:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filed extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684623#M233693</link>
      <description>&lt;P&gt;This is an example using makeresults and rex&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="Test1=101,Test2=102,Test3=103,Test4=104,Test5=105,Test6=106,Test7=107,Test8=108,Test9=109,Test101=110"
| makemv _raw delim=","
| rex field=_raw "(?&amp;lt;field&amp;gt;Test7)=(?&amp;lt;value&amp;gt;\d+)"
| table field value&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 Apr 2024 11:47:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684623#M233693</guid>
      <dc:creator>deepakc</dc:creator>
      <dc:date>2024-04-18T11:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Filed extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684630#M233695</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79189"&gt;@deepakc&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thank you for reply.&lt;BR /&gt;&lt;BR /&gt;_raw data is not static it going to change every minute.&lt;BR /&gt;could u pls let know how to use "eval" for data which going to be changed.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 11:49:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684630#M233695</guid>
      <dc:creator>moinoddinyadgir</dc:creator>
      <dc:date>2024-04-18T11:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Filed extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684844#M233744</link>
      <description>&lt;P&gt;Do you mean to say that each event contains a row of headers and another row of values like the following?&lt;/P&gt;&lt;PRE&gt;Test1 Test2 Test3 Test4 Test5 Test6 Test7 Test8 Test9 Test
10 101 102 103. 104. 105. 106. 107. 108. 109. 110&lt;/PRE&gt;&lt;P&gt;The easiest is like&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;suggested, create a form to match this format, then use kvform.&lt;/P&gt;&lt;P&gt;No matter which method you use, you have to answer one question: What is the delimiter? &amp;nbsp;Obviously there is no comma. &amp;nbsp;But it is totally unclear whether the delimiter would be one space character, one tab character, or any number of white space characters can be interpreted as one delimiter. &amp;nbsp;Suitable solution can be different when delimiter is different.&lt;/P&gt;&lt;P&gt;Here I illustrate a solution without using kvform that works with any number of white spaces between fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed "s/\n/::/ s/\s+/,/g s/::/
/"
| multikv&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your sample data will give you&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test10&lt;/TD&gt;&lt;TD&gt;Test2&lt;/TD&gt;&lt;TD&gt;Test3&lt;/TD&gt;&lt;TD&gt;Test4&lt;/TD&gt;&lt;TD&gt;Test5&lt;/TD&gt;&lt;TD&gt;Test6&lt;/TD&gt;&lt;TD&gt;Test7&lt;/TD&gt;&lt;TD&gt;Test8&lt;/TD&gt;&lt;TD&gt;Test9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;110&lt;/TD&gt;&lt;TD&gt;102&lt;/TD&gt;&lt;TD&gt;103.&lt;/TD&gt;&lt;TD&gt;104.&lt;/TD&gt;&lt;TD&gt;105.&lt;/TD&gt;&lt;TD&gt;106.&lt;/TD&gt;&lt;TD&gt;107.&lt;/TD&gt;&lt;TD&gt;108.&lt;/TD&gt;&lt;TD&gt;109.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;As I said, this is just one possible solution, and is most suitable if the number of white spaces (and even type of white spaces) between fields cannot be predetermined AND that field names and values do not contain any white space.&lt;/P&gt;&lt;P&gt;Here is an emulation that you can play with and compare with real data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw = "Test1 Test2 Test3 Test4 Test5 Test6 Test7 Test8 Test9 Test10
101    102     103.    104.     105.   106.   107.   108.   109.    110"
``` data emulation above ```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Apr 2024 05:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684844#M233744</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-04-20T05:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filed extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684848#M233745</link>
      <description>&lt;P&gt;If your data is always in the same order, as others already suggested, it's just matter of setting up either regex-based or delimiter-based extraction to find a value in given position.&lt;/P&gt;&lt;P&gt;But if the problem lies in the fact that column order can change (and is always determined by a header row in a file), only INDEXED_EXTRACTIONS can help because Splunk processes each event separately so it has no way of knowing which "format" particular row belongs go if different files had different header rows.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Apr 2024 06:12:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filed-extraction/m-p/684848#M233745</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-04-20T06:12:47Z</dc:date>
    </item>
  </channel>
</rss>

