Sponsored Content
Top Forums Shell Programming and Scripting Grep the Content of a LOG File which has latest Date and Time Post 302551091 by nvindraneel on Monday 29th of August 2011 11:17:41 AM
Old 08-29-2011
Data Grep the Content of a LOG File which has latest Date and Time

Hi All,

Need a small help. I have a log file which keeps updating for every Minute with multiple number of lines. I just want to grep few properties which has latest Date and Time to it. How do i do it?

I wanted to grep a property by name "Reloading cache with a maximum of" from the "123.log" which has some thousands of lines in it

When i use the command "cat 123.log | grep 'Reloading cache with a maximum of' " it fetches the data something like this


"2011-08-29/08:07:44.219 INFO EJB-Timer-0a6c6b1d-563b-4c3a-a756-c854ab44364e[target=jboss.j2ee:ear=ear-xxxx-xxx-xxxxx.ear,jar=xxx-xxxxx-xxx-253134.jar,name= / Reloading cache with a maximum of 10000 loads

2011-08-29/08:08:44.230 INFO EJB-Timer-0a6c6b1d-563b-4c3a-a756-c854ab44364e[target=jboss.j2ee:ear=ear-xxxx-xxx-xxxxx.ear,jar=xxx-xxxxx-xxx-253134.jar,name= / Reloading cache with a maximum of 10000 loads

2011-08-29/08:09:44.242 INFO EJB-Timer-0a6c6b1d-563b-4c3a-a756-c854ab44364e[target=jboss.j2ee:ear=ear-xxxx-xxx-xxxxx.ear,jar=xxx-xxxxx-xxx-253134.jar,name= / Reloading cache with a maximum of 10000 loads "

I always wanted my script to get the last row which has latest date and time in it.


Can someone please HELP its urgent..........
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Date and time log file

Hi, I wrote a small perl script in unix that searches in a file and saves some information in a separate file. Since this is a log file, I would like to have the date added to file name. I have no idea where to start. output: log_010907.txt thanks ken (8 Replies)
Discussion started by: captoro
8 Replies

2. Shell Programming and Scripting

Processing a log file based on date/time input and the date/time on the log file

Hi, I'm trying to accomplish the following and would like some suggestions or possible bash script examples that may work I have a directory that has a list of log files that's periodically dumped from a script that is crontab that are rotated 4 generations. There will be a time stamp that is... (4 Replies)
Discussion started by: primp
4 Replies

3. Shell Programming and Scripting

shell script to find latest date and time of the files

Hi everyone, Please help:) I have a list of 1000 different files which comes daily to the directory.Some of the files are not coming to the directory now. I need to write a shell script to find the latest date and time of the files they came to the directory. The files should be unique.... (1 Reply)
Discussion started by: karthicss
1 Replies

4. Shell Programming and Scripting

grep to show date/time of file the string was found in.

I've seen several examples of grep showing the filename the string was found in, but what I really need is grep to show the file details in long format (like ls -l would). scenario is: grep mobile_number todays_files This will show me the string I'm after & which files they turn up in, but... (2 Replies)
Discussion started by: woodstock
2 Replies

5. Shell Programming and Scripting

grep latest file based on date.

hi all, not sure if this has been posted b4 but i try to search but not valid. this is my question: when i do a ls -ltr there will be a list generated as follows: -rw-r--r-- 1 root sys 923260 Jan 10 04:38 FilePolling.41025.083TL021.xml -rw-r--r-- 1 root sys 1761337 Jan 10 04:40... (12 Replies)
Discussion started by: lweegp
12 Replies

6. Shell Programming and Scripting

Delete log files content older than 30 days and append the lastest date log file date

To delete log files content older than 30 days and append the lastest date log file date in the respective logs I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs This is my script cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies

7. Shell Programming and Scripting

Remove Duplicates on multiple Key Columns and get the Latest Record from Date/Time Column

Hi Experts , we have a CDC file where we need to get the latest record of the Key columns Key Columns will be CDC_FLAG and SRC_PMTN_I and fetch the latest record from the CDC_PRCS_TS Can we do it with a single awk command. Please help.... (3 Replies)
Discussion started by: vijaykodukula
3 Replies

8. Shell Programming and Scripting

How to extract latest file by looking at date time stamp from a directory?

hi, i have a Archive directory in which files are archived or stored with date and time stamp to prevent over writing. example: there are 5 files s1.txt s2.txt s3.txt s4.txt s5.txt while moving these files to archive directory, date and time stamp is added. of format `date... (9 Replies)
Discussion started by: Little
9 Replies

9. UNIX for Dummies Questions & Answers

Does 'grep' update a file's access date/time?

I've got a job that finds and removes trace files based upon an access time of more than seven days (I've also tried a modify date). find TABC* -atime +7 -exec rm + find TABC* -mtime +7 -exec rm + Whether I use -atime or -mtime, the process seems to work sporadically. Sometimes it removes... (6 Replies)
Discussion started by: Scottie1954
6 Replies

10. Shell Programming and Scripting

Read latest file name with a date and time and then download from FTP

Hi All, Please help. I have requirement to read the file / folder based on the latest date and download the file and folder. There will be files and folders in the location like 20140630-144422 20140630-144422.csv 20140707-182653 20140707-182653.csv 20140710-183153... (7 Replies)
Discussion started by: Praveen Pandit
7 Replies
asadmin-deploy(1AS)						   User Commands					       asadmin-deploy(1AS)

NAME
asadmin-deploy, deploy - deploys the specifiedcomponent SYNOPSIS
deploy --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile filename] [--terse=false] [--echo=false] [--interactive] [--virtualservers virtual_servers] [--contextroot context_root] [--force=true] [--precom- pilejsp=false] [--verify=false] [--name component_name] [--upload=true] [--retrieve local_dirpath] [--dbvendorname dbvendorname] [--cre- atetables=true|false | --dropandcreatetables=true|false] [--uniquetablenames=true|false] [--deploymentplan deployment_plan] [--enabled=true] filepath Deploys an EJB, web, connector or application. If the component is already deployed or already exists, it is forcefully re-deployed if the --force option is set to true. The --createtables and --dropandcreatetables options are booleans and therefore can take the values of true or false. These options are only used during deployment of CMP beans that have not been mapped to a database (i.e., no sun-cmp-mappings.xml descriptor is provided in the module's META-INF directory). They are ignored otherwise. The --createtables option and --dropandcreatetables option are mutually exclusive; only one should be used. If drop and/or create tables fails, the deployment does not fail; a warning message is provided in the log file. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. --echo setting to true will echo the command line statement on the standard output. --interactive prompts you for the required options that are not already specified. --virtualservers comma separated list of virtual server name. --contextroot valid only if the archive is a web module. It is ignored for other archive types; defaults to filename without extension. --force makes sure the component is forcefully (re)deployed even if the specified component has already been deployed or already exists. --precompilejsp by default is set to false which does not allow the JSP to pre-compile during deployment. Instead JSPs are compiled during runtime. --verify if set to true, the syntax and semantics of the deployment descriptor is verified. --name name of the deployable component. --upload when set to true, uploads the deployable file to the administration server. If the filepath of the deployable file is mounted to the server machine, or if the administration server is running locally, set the upload option to false. --retrieve retrieves the client stub JAR file from the server machine to the local directory. --dbvendorname name of database vendor being used. Default is the corresponding entry in the cmp-resource() element of the sun- ejb-jar.xml file. If not specified the default is SQL92. Thereby the DDL files to create and drop tables will be generated in SQL92 format. --createtables creates tables at deploy of an application with unmapped CMP beans. Default is the corresponding entry in the cmp- resource element of the sun-ejb-jar.xml file. If not specified, defaults to the entries specified in the deployment descriptors. --dropandcreatetables drops tables at redeploy of an already deployed application with unmapped CMP beans. If not specified, the tables will be dropped if the drop-tables-at-undeploy entry in the cmp-resource element of the sun-ejb-jar.xml file is set to true. The new tables are created if the create-tables-at-deploy entry in the cmp-resource element of the sun- ejb-jar.xml file is set to true. On redeploy the tables created by the previous deploy are dropped before creating the new tables. --uniquetablenames guarantees unique table names for all the beans and results in a hashcode added to the table names. This is useful if you have an application with case-sensitive bean names. --deploymentplan takes the deployment plan, which is a JAR containing Sun-specific descriptors, and deploys it. This should be passed along when deploying a pure EAR file. A pure EAR file is an EAR without Sun-specific descriptors. --enabled if set to true (default), allows user to access the application. If set to false, user will not be able to access the application. OPERANDS
filepath path to the deployable file on the local machine if the --upload option is set to true; otherwise the absolute path to the file on the server machine. Example 1: Deploying a J2EE application Deploy (install) the J2EE application packaged in the Cart.ear file. asadmin> deploy --user admin --password admin123 --host murph --port 4848 Cart.ear Command deploy executed successfully Example 2: Deploying a Web application with the default context root Deploy the Web application in the hello.war file at the hello context root. asadmin> deploy --user admin hello.war Command deploy executed successfully Example 3: Deploying an enterprise bean (EJB component) Deploy and enterprise bean with container-managed persistence (CMP) and create the database tables used by the bean. asadmin> deploy --user admin --createtables=true EmployeeEJB.jar Command deploy executed successfully Example 4: Deploying a connector module (resource adapter) Deploy a connector module packaged in a RAR file. asadmin> deploy --user admin jdbcra.rar Command deploy executed successfully EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-undeploy(1AS), asadmin-list-components(1AS) J2EE 1.4 SDK March 2004 asadmin-deploy(1AS)
All times are GMT -4. The time now is 04:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy