<?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 How to trim information from search output? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-information-from-search-output/m-p/596224#M207554</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am having the following query:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index=* sourcetype=CustomAccessLog | table "host", "source"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output is:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;host&lt;/TD&gt;
&lt;TD width="50%"&gt;source&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;server32.de.db.com&lt;/TD&gt;
&lt;TD width="50%"&gt;/path/to/server/instances/IFM_RT_1/logs/subdir_logs/log.file&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;server31.de.db.com&lt;/TD&gt;
&lt;TD&gt;/path/to/server/instances/IFM_RT_2/logs/subdir_logs/log.file&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would need to alter the search query so that the output is becoming:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;host&lt;/TD&gt;
&lt;TD width="50%"&gt;source&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;32&lt;/TD&gt;
&lt;TD width="50%"&gt;IFM_RT_1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;31&lt;/TD&gt;
&lt;TD&gt;IFM_RT_2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tried using the following for the IFM_RT_&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;index=* sourcetype=CustomAccessLog | rex field=_raw "(?&amp;lt;IFM_RT_&amp;gt;.*)", but I couldn't get the needed data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can I have your help here?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2022 16:02:47 GMT</pubDate>
    <dc:creator>jugarugabi</dc:creator>
    <dc:date>2022-05-03T16:02:47Z</dc:date>
    <item>
      <title>How to trim information from search output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-information-from-search-output/m-p/596224#M207554</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am having the following query:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index=* sourcetype=CustomAccessLog | table "host", "source"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output is:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;host&lt;/TD&gt;
&lt;TD width="50%"&gt;source&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;server32.de.db.com&lt;/TD&gt;
&lt;TD width="50%"&gt;/path/to/server/instances/IFM_RT_1/logs/subdir_logs/log.file&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;server31.de.db.com&lt;/TD&gt;
&lt;TD&gt;/path/to/server/instances/IFM_RT_2/logs/subdir_logs/log.file&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would need to alter the search query so that the output is becoming:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;host&lt;/TD&gt;
&lt;TD width="50%"&gt;source&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;32&lt;/TD&gt;
&lt;TD width="50%"&gt;IFM_RT_1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;31&lt;/TD&gt;
&lt;TD&gt;IFM_RT_2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tried using the following for the IFM_RT_&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;index=* sourcetype=CustomAccessLog | rex field=_raw "(?&amp;lt;IFM_RT_&amp;gt;.*)", but I couldn't get the needed data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can I have your help here?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 16:02:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-information-from-search-output/m-p/596224#M207554</guid>
      <dc:creator>jugarugabi</dc:creator>
      <dc:date>2022-05-03T16:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-information-from-search-output/m-p/596227#M207557</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230692"&gt;@jugarugabi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could try to use the following regexes:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* sourcetype=CustomAccessLog 
| rex field=source "(?&amp;lt;source&amp;gt;IFM_RT_\d*)"
| rex field=host "^server(?&amp;lt;host&amp;gt;\d+)"
| table host source&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 09:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-information-from-search-output/m-p/596227#M207557</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-05-03T09:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming information</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-trim-information-from-search-output/m-p/596813#M207744</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/230692"&gt;@jugarugabi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 May 2022 05:34:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-trim-information-from-search-output/m-p/596813#M207744</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-05-07T05:34:53Z</dc:date>
    </item>
  </channel>
</rss>

