<?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: How to not display the source only as a Atmchk1a for the entire path? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296783#M56273</link>
    <description>&lt;P&gt;yes as @micahkemp suggested try this regex to get separate site name w.r.t. source name,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=source "^/([^/]+/){3}(?&amp;lt;source&amp;gt;[^/]+(?&amp;lt;site&amp;gt;[0-9]+)[^/]+?)/"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 17 Feb 2018 03:38:52 GMT</pubDate>
    <dc:creator>493669</dc:creator>
    <dc:date>2018-02-17T03:38:52Z</dc:date>
    <item>
      <title>How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296779#M56269</link>
      <description>&lt;P&gt;I have source below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/prod/app/atm/ATMCHKMI1a/logs/catalina.out
/prod/app/atm/ATMCHKMI2a/logs/catalina.out
/prod/app/atm/ATMFOTN1a/logs/catalina.out
/prod/app/atm/ATMFITNA2a/logs/catalina.out
/prod/app/atm/ATMATMASS1a/logs/catalina.out
/prod/app/atm/ATMATMASS2a/logs/catalina.out
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want the source to display only as an Atmchk1a for first and so on and not the entire path.&lt;BR /&gt;
How to do it?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 17:38:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296779#M56269</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2018-02-16T17:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296780#M56270</link>
      <description>&lt;P&gt;You can use rex in sed mode:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;base search&amp;gt;|rex field=source mode=sed "s/^\/[^\/]+\/[^\/]+\/[^\/]+\/(\w+).*/\1/"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR simply use rex command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;base search&amp;gt;|rex field=source "^\/[^\/]+\/[^\/]+\/[^\/]+\/(?&amp;lt;source&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;try this run anywhere search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults|eval source="/prod/app/atm/ATMCHKMI1a/logs/catalina.out"|rex field=source mode=sed "s/^\/[^\/]+\/[^\/]+\/[^\/]+\/(\w+).*/\1/"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Feb 2018 17:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296780#M56270</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-16T17:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296781#M56271</link>
      <description>&lt;P&gt;Thanks, It worked.&lt;BR /&gt;
Also, if I want to separate into two site as well i.e. ATMCHKMI1a shows as site 1 and ATMCHKMI2a shows as site 2 and similarly for others. How to do that?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 03:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296781#M56271</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2018-02-17T03:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296782#M56272</link>
      <description>&lt;P&gt;I think rex with capture groups would enable you to get the name and site efficiently:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval source="/prod/app/atm/ATMCHKMI1a/logs/catalina.out"
| append [| makeresults | eval source="/prod/app/atm/ATMCHKMI2a/logs/catalina.out"]
| append [| makeresults | eval source="/prod/app/atm/ATMFOTN1a/logs/catalina.out"]
| append [| makeresults | eval source="/prod/app/atm/ATMFITNA2a/logs/catalina.out"]
| append [| makeresults | eval source="/prod/app/atm/ATMATMASS1a/logs/catalina.out"]
| append [| makeresults | eval source="/prod/app/atm/ATMATMASS2a/logs/catalina.out"]

| rex field=source "^/([^/]+/){3}(?&amp;lt;name&amp;gt;[^/]+(?&amp;lt;site&amp;gt;[0-9]+)[^/]+?)/"
| eval site="site ".site
| table name site &amp;lt;other fields&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The regex looks for three path components before the extracted &lt;CODE&gt;name&lt;/CODE&gt;, with &lt;CODE&gt;site&lt;/CODE&gt; extracted as the last digits of the name.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 03:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296782#M56272</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-02-17T03:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296783#M56273</link>
      <description>&lt;P&gt;yes as @micahkemp suggested try this regex to get separate site name w.r.t. source name,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=source "^/([^/]+/){3}(?&amp;lt;source&amp;gt;[^/]+(?&amp;lt;site&amp;gt;[0-9]+)[^/]+?)/"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Feb 2018 03:38:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296783#M56273</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-17T03:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296784#M56274</link>
      <description>&lt;P&gt;Hi Micahkemp,&lt;/P&gt;

&lt;P&gt;It did not work,&lt;/P&gt;

&lt;P&gt;We now have got the source as below from the full path which I wanted.&lt;BR /&gt;
ATMatmasst1a&lt;BR /&gt;&lt;BR /&gt;
ATMatmasst2a&lt;BR /&gt;&lt;BR /&gt;
ATMatmasstportal1a&lt;BR /&gt;&lt;BR /&gt;
ATMcdprof1a &lt;BR /&gt;
ATMcdprof2a &lt;BR /&gt;
ATMchkimg1a &lt;BR /&gt;
ATMchkimg2a &lt;BR /&gt;
ATMchkimgclt1prod&lt;BR /&gt;&lt;BR /&gt;
ATMciv1a&lt;BR /&gt;&lt;BR /&gt;
ATMcmprspclt1prod&lt;BR /&gt;&lt;BR /&gt;
ATMcrdreissueclt1prod&lt;BR /&gt;&lt;BR /&gt;
ATMcusprof1a&lt;BR /&gt;&lt;BR /&gt;
ATMcusprof2a&lt;BR /&gt;&lt;BR /&gt;
ATMdepositjamclt1prod&lt;BR /&gt;&lt;BR /&gt;
ATMelgbacctflnkg1a&lt;BR /&gt;&lt;BR /&gt;
ATMelgbacctflnkg2a&lt;BR /&gt;&lt;BR /&gt;
ATMercpt1a&lt;/P&gt;

&lt;P&gt;But now I want a table which which shows in a below manner&lt;/P&gt;

&lt;H2&gt;source                    site      host     starttime&lt;/H2&gt;

&lt;P&gt;where&lt;BR /&gt;
ATMcusprof2a                     is  site 2&lt;BR /&gt;&lt;BR /&gt;
ATMelgbacctflnkg1a     is        site 1    &lt;/P&gt;

&lt;P&gt;and so on.....&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 03:55:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296784#M56274</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2018-02-17T03:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296785#M56275</link>
      <description>&lt;P&gt;Changed it to add the word "site" to the &lt;CODE&gt;site&lt;/CODE&gt; field, and added in a table command.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 03:59:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296785#M56275</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-02-17T03:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296786#M56276</link>
      <description>&lt;P&gt;Thanks Micahkemp, appreciated your help.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 04:16:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296786#M56276</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2018-02-17T04:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296787#M56277</link>
      <description>&lt;P&gt;HI Micahkemp,&lt;/P&gt;

&lt;P&gt;Can you please tell me good sites from where I can learn regex?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 04:21:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296787#M56277</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2018-02-17T04:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296788#M56278</link>
      <description>&lt;P&gt;&lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt; is a great site to test regexes.  As for learning them, I'd have to defer to google on that one, as I don't have a recommendation handy.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 04:22:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296788#M56278</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-02-17T04:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to not display the source only as a Atmchk1a for the entire path?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296789#M56279</link>
      <description>&lt;P&gt;@abhi04,&lt;BR /&gt;
&lt;CODE&gt;&lt;A href="https://regexone.com/" target="test_blank"&gt;https://regexone.com/&lt;/A&gt;&lt;/CODE&gt; is also good site to start regex learning&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 05:40:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-not-display-the-source-only-as-a-Atmchk1a-for-the-entire/m-p/296789#M56279</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-17T05:40:46Z</dc:date>
    </item>
  </channel>
</rss>

