Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6809541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:05:55+00:00 2026-05-26T20:05:55+00:00

monitorUrl– http://host03:8810/solr/admin/stats.jsp which contains this xml file. <?xml-stylesheet type=text/xsl href=stats.xsl?> <solr> <core></core> <schema>test</schema> <host>domain.host.com</host>

  • 0

monitorUrl– http://host03:8810/solr/admin/stats.jsp which contains this xml file.

    <?xml-stylesheet type="text/xsl" href="stats.xsl"?>
<solr>

      <core></core> 

  <schema>test</schema>
  <host>domain.host.com</host>
  <now>Fri Nov 11 11:14:01 PST 2011</now>
  <start>Thu Sep 22 18:33:06 PDT 2011</start>
  <solr-info>

    <CORE>

    <entry>
      <name>
        core
      </name>
      <class>

      </class>
      <version>
        1.0
      </version>
      <description>
        SolrCore
      </description>
      <stats>

        <stat name="coreName" >

        </stat>

        <stat name="startTime" >
          Thu Sep 22 18:33:06 PDT 2011
        </stat>

        <stat name="refCount" >
          2
        </stat>

        <stat name="aliases" >
          []
        </stat>

      </stats>
    </entry>


    <entry>
      <name>
        searcher
      </name>
      <class>
        org.apache.solr.search.SolrIndexSearcher
      </class>
      <version>
        1.0
      </version>
      <description>
        index searcher
      </description>
      <stats>

        <stat name="searcherName" >
          Searcher@5b637a2d main
        </stat>

        <stat name="caching" >
          true
        </stat>

        <stat name="numDocs" >
          111959
        </stat>

        <stat name="maxDoc" >
          112310
        </stat>

        <stat name="reader" >
          DirectoryReader(segments_h0 _1zn:Cv101710/351 _1zl:Cv8026 _1zp:Cv2574)
        </stat>

        <stat name="readerDir" >
          org.apache.lucene.store.NIOFSDirectory@/es_idx_prd/projects/index/solr-agile/document/data/index lockFactory=org.apache.lucene.store.NativeFSLockFactory@2c164804
        </stat>

        <stat name="indexVersion" >
          1313979005459
        </stat>

        <stat name="openedAt" >
          Fri Nov 11 11:00:04 PST 2011
        </stat>

        <stat name="registeredAt" >
          Fri Nov 11 11:00:04 PST 2011
        </stat>

        <stat name="warmupTime" >
          0
        </stat>

      </stats>
    </entry>

     </solr-info>
</solr>

And I want to extract the numDocs value from the above xml means 111959–

111959

And the below fetchlog method is just reading each line of that jsp file. So how can I retrieve numDocs value by fetching it directly by reading it line by line.

The monitorUrl is a .jsp file which is in xml format.

public void fetchlog() {
        InputStream is = null;
        FileOutputStream fos = null;
        try {
            is = HttpUtil.getFile(monitorUrl);
            BufferedReader in   = 
                new BufferedReader (new InputStreamReader (is));
            String line;
            while ((line = in.readLine()) != null) {
                if(line.contains("numDocs")) {
            //Extract numDocs value- How to do this?        
                }
                System.out.println(line);
            }

            fos = new FileOutputStream(buildTargetPath());
            IOUtils.copy(is, fos);
        } catch (FileNotFoundException e) {
            log.error("File Exception in fetching monitor logs :" + e);
        } catch (IOException e) {
            log.error("Exception in fetching monitor logs :" + e);
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:05:56+00:00Added an answer on May 26, 2026 at 8:05 pm

    To follow up on my comments, if the XML/text structure is going to be the same, then you can do,

     if(line.contains("numDocs")) {
         //Extract numDocs value- How to do this?
         String numDocs = in.readLine(); // May need trimming.
         System.out.println("Num docs:" + numDocs);   
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here monitorUrl contains- http://host:8810/solr/admin/stats.jsp and monitorUrl sometimes can be-- http://host:8810/solr/admin/monitor.jsp So i want to
I am trying to monitor URL's which are in my database. I an using
I am building an android game in which I am attempting to download the
I have a Jenkins project that builds an application and then, if successful, copies
When I define (using axis 1.4 an wss4j) in client-config.wsdd for WSDoAllSender and WSDoAllReceiver
Is there, with Javascript, a way to monitor URL changed via 302 redirects on
I have an ASP.NET DataGrid that I am trying to add a HoverMenu Extender

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.