<?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: Field Extraction issue in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239748#M176535</link>
    <description>&lt;P&gt;You have few options. &lt;/P&gt;

&lt;P&gt;1) Edit props/transforms per instructions in the blog post. Your data appears to be space delimited, so you will specific &lt;CODE&gt;" "&lt;/CODE&gt; in your transforms instead of &lt;CODE&gt;","&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2013/03/11/quick-n-dirty-delimited-data-sourcetypes-and-you/"&gt;http://blogs.splunk.com/2013/03/11/quick-n-dirty-delimited-data-sourcetypes-and-you/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;2) The other option is to use &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;Interactive Field Extractor (IFX)&lt;/A&gt; to extract the fields as space delim. IFX will generate the similar props/transforms edits for the extractions.&lt;/P&gt;

&lt;P&gt;3) Use regex in your SPL like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | rex "(?&amp;lt;f1&amp;gt;[^\s]+)\s(?&amp;lt;f2&amp;gt;[^\s]+)\s(?&amp;lt;f3&amp;gt;[^\s]+)\s(?&amp;lt;f4&amp;gt;[^\s]+)\s(?&amp;lt;f5&amp;gt;[^\s]+)\s(?&amp;lt;f6&amp;gt;[^\s]+)" | table f*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 08 Oct 2016 20:02:20 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-10-08T20:02:20Z</dc:date>
    <item>
      <title>Field Extraction issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239746#M176533</link>
      <description>&lt;P&gt;HI Experts,&lt;BR /&gt;
i am able to exact 4th and 5th fields from below log but i am able to exact get the value if the 4th or 5th filed is HOSTNAME but if it is IPaddress then i am not able retrieve.here is the sample log&lt;/P&gt;

&lt;P&gt;tcp        0      0 10.40.88.178:7171 10.40.88.175:50326 ESTABLISHED&lt;BR /&gt;
tcp        0      0 12b8-splfwd02.ndm.nsro:7171 10.40.88.170:50326 TIME_WAIT&lt;BR /&gt;
tcp        0      0 10.40.88.178:7171 poc-card-luna2.nad.ns:50326 TIME_WAIT&lt;BR /&gt;
tcp        0      0 12b8-splfwd02.ndm.nsro:7171 10.30.88.145:50326 ESTABLISHED&lt;BR /&gt;
tcp        0      0 10.40.88.178:7171 poc-card-luna4.nad.ns:50326 SYNC_SENT&lt;BR /&gt;
tcp        0      0 12b8-splfwd03.ndm.nsro:7171 poc-card-luna1.nad.ns:46756 TIME_WAIT&lt;BR /&gt;
tcp        0      0 12b8-splfwd03.ndm.nsro:7171 10.30.88.117:46756 SYNC_SENT&lt;BR /&gt;
tcp        0      0 10.40.88.178:7171 poc-card-luna2.nad.ns:46756 TIME_WAIT&lt;BR /&gt;
tcp        0      0 12b8-splfwd03.ndm.nsro:7171 10.40.83.157:46756 TIME_WAIT&lt;BR /&gt;
tcp        0      0 12b8-splfwd03.ndm.nsro:7171 poc-card-luna4.nad.ns:46756 ESTABLISHED&lt;BR /&gt;
tcp        0      0 12b8-splfwd04.ndm.nsro:7171 poc-card-luna1.nad.ns:46756 TIME_WAIT&lt;BR /&gt;
tcp        0      0 10.40.88.178:7171 poc-card-luna3.nad.ns:46756 SYNC_SENT&lt;BR /&gt;
tcp        0      0 12b8-splfwd04.ndm.nsro:7171 poc-card-luna2.nad.ns:46756 SYNC_SENT&lt;BR /&gt;
tcp        0      0 12b8-splfwd04.ndm.nsro:7171 poc-card-luna4.nad.ns:46756 ESTABLISHED&lt;BR /&gt;
tcp        0      0 12b8-splfwd04.ndm.nsro:7171 poc-card-luna2.nad.ns:46756 ESTABLISHED&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:20:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239746#M176533</guid>
      <dc:creator>rajgowd1</dc:creator>
      <dc:date>2020-09-29T11:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239747#M176534</link>
      <description>&lt;P&gt;How are you extracting the fields?  Is this a search-time or index-time extraction?&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2016 19:49:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239747#M176534</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-10-08T19:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239748#M176535</link>
      <description>&lt;P&gt;You have few options. &lt;/P&gt;

&lt;P&gt;1) Edit props/transforms per instructions in the blog post. Your data appears to be space delimited, so you will specific &lt;CODE&gt;" "&lt;/CODE&gt; in your transforms instead of &lt;CODE&gt;","&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2013/03/11/quick-n-dirty-delimited-data-sourcetypes-and-you/"&gt;http://blogs.splunk.com/2013/03/11/quick-n-dirty-delimited-data-sourcetypes-and-you/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;2) The other option is to use &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;Interactive Field Extractor (IFX)&lt;/A&gt; to extract the fields as space delim. IFX will generate the similar props/transforms edits for the extractions.&lt;/P&gt;

&lt;P&gt;3) Use regex in your SPL like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | rex "(?&amp;lt;f1&amp;gt;[^\s]+)\s(?&amp;lt;f2&amp;gt;[^\s]+)\s(?&amp;lt;f3&amp;gt;[^\s]+)\s(?&amp;lt;f4&amp;gt;[^\s]+)\s(?&amp;lt;f5&amp;gt;[^\s]+)\s(?&amp;lt;f6&amp;gt;[^\s]+)" | table f*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Oct 2016 20:02:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239748#M176535</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-08T20:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239749#M176536</link>
      <description>&lt;P&gt;Hi Rich,thanks for your response.&lt;BR /&gt;
From logs,I am trying to extract using splunk UI.&lt;BR /&gt;
I think I am able extract multiple fields.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2016 20:02:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239749#M176536</guid>
      <dc:creator>rajgowd1</dc:creator>
      <dc:date>2016-10-08T20:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239750#M176537</link>
      <description>&lt;P&gt;Hi Rich,thanks for your response.&lt;BR /&gt;
From logs,I am trying to extract using splunk UI.&lt;BR /&gt;
I think I am able extract multiple fields.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2016 20:02:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239750#M176537</guid>
      <dc:creator>rajgowd1</dc:creator>
      <dc:date>2016-10-08T20:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239751#M176538</link>
      <description>&lt;P&gt;Below Regex can be used in field extractor in write your own regular expression syntax:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
^(?&amp;lt; protocol&amp;gt;[\S]+)\s*?(?&amp;lt; field1&amp;gt;[\S]+)\s*?(?&amp;lt; field2&amp;gt;[\S]+)\s*?(?&amp;lt; hostOrIp1&amp;gt;[^:]+):(?&amp;lt; hostOrIp1Port&amp;gt;[\S]+)\s*?(?&amp;lt; hostOrIp2&amp;gt;[^:]+):(?&amp;lt; hostOrIp2Port&amp;gt;[\S]+)\s.*?(?&amp;lt; state&amp;gt;[\S]+)&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;During search time this regex can also be used with rex to extract fields if fields are not already extracted:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
yourBaseSearch&lt;BR /&gt;
|rex field=_raw "^(?&amp;lt; protocol&amp;gt;[\S]+)\s*?(?&amp;lt; field1&amp;gt;[\S]+)\s*?(?&amp;lt; field2&amp;gt;[\S]+)\s*?(?&amp;lt; hostOrIp1&amp;gt;[^:]+):(?&amp;lt; hostOrIp1Port&amp;gt;[\S]+)\s*?(?&amp;lt; hostOrIp2&amp;gt;[^:]+):(?&amp;lt; hostOrIp2Port&amp;gt;[\S]+)\s.*?(?&amp;lt; state&amp;gt;[\S]+)"&lt;BR /&gt;
| table hostOrIp1, hostOrIp2&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; Please remove the space in each of the tags, example "&amp;lt; protocol&amp;gt;", "&amp;lt; field1&amp;gt;" etc.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:19:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239751#M176538</guid>
      <dc:creator>govindsinghrawa</dc:creator>
      <dc:date>2020-09-29T11:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239752#M176539</link>
      <description>&lt;P&gt;If you're using the Splunk UI you're probably using the automatic field extractor which is most likely producing a regex string that is too specific.  Try this regex, instead.  It skips the first three space-delimited fields and extracts the next two space-delimited fields as 'src' and 'dest', respectively.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?:[^\s]+\s){3}(?P&amp;lt;src&amp;gt;[^\s]+)\s(?&amp;lt;dest&amp;gt;[^\s]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Perhaps you want the 4th and 5th fields to be the host name/IP address and port.  That regex string is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?:[^ ]+ ){3}(?P&amp;lt;src&amp;gt;[^:]+):(?&amp;lt;dest&amp;gt;\d+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Oct 2016 20:17:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239752#M176539</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-10-08T20:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239753#M176540</link>
      <description>&lt;P&gt;Thank you govindsinghrawat.i am trying to create visualization by using all your experts answers.&lt;BR /&gt;
is there way to create visualization by using similar search &lt;/P&gt;

&lt;P&gt;both are giving same results&lt;/P&gt;

&lt;P&gt;index=netstat|rex field=_raw "^(?[\S]+)\s*?(?[\S]+)\s*?(?[\S]+)\s*?(?[^:]+):(?[\S]+)\s*?(?[^:]+):(?[\S]+)\s.*?(?[\S]+)"&lt;BR /&gt;
| eventstats count by state hostOrIp1 hostOrIp2 |eval CountConnStatus=count+" - "+state|chart values(CountConnStatus) by hostOrIp1 hostOrIp2&lt;/P&gt;

&lt;P&gt;index=netstat |rex "(?[a-zA-Z0-9][^\s]+)\s(?[^\s]+)\s(?.*)" |eventstats count by CONN_STATUS CBOL_SERVER HSM |eval CountConnStatus=count+" - "+CONN_STATUS|chart values(CountConnStatus) by CBOL_SERVER HSM&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:20:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239753#M176540</guid>
      <dc:creator>rajgowd1</dc:creator>
      <dc:date>2020-09-29T11:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239754#M176541</link>
      <description>&lt;P&gt;Hi @rajgowd&lt;/P&gt;

&lt;P&gt;The above regex which I gave is to extract fields. Once the fields are extracted then you can use them i your commands.&lt;/P&gt;

&lt;P&gt;Now coming to visulaizations. Visualizations can only be created depending on how you end your search, for example :&lt;/P&gt;

&lt;P&gt;if you end your search with timechart command then you will immediately have visualization options for line, bar etch. Example:&lt;BR /&gt;
yourBaseSearch | timechart count by yourField&lt;/P&gt;

&lt;P&gt;If you have statistics being generated as aggregations like min, max, sum etc you can plot them using timechart, chart etc.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2016 06:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-issue/m-p/239754#M176541</guid>
      <dc:creator>govindsinghrawa</dc:creator>
      <dc:date>2016-10-15T06:00:03Z</dc:date>
    </item>
  </channel>
</rss>

