Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. johngiggs

    How do I print from a specific string to a new line with a matching pattern

    Hi, Thank you for that suggestion. It did work for the example, however my example wasn't clear enough. There are some WARN lines that I want to ignore. I want to capture ERROR and the subsequent lines below it until the next new line with a datestamp. 2022-04-07 12:46:14,624-0400 some text...
  2. johngiggs

    How do I print from a specific string to a new line with a matching pattern

    Hi, I have a log file I want to parse. Lines normally begin like this: 2022-04-07 12:46:14,624-0400 some text here 2022-04-07 12:46:14,625-0400 some more text here 2022-04-07 12:46:14,625-0400 ERROR something oh my gosh this is terrible bad error message 2022-04-07...
  3. johngiggs

    Awk Script Using a Secondary Input File

    Hi, I've deployed a temporary hacky workaround of using a for loop with the employee_departments.txt file and using sed to replace all of the values, but I'm sure there is a much more efficient way to accomplish this. Thanks!
  4. johngiggs

    Awk Script Using a Secondary Input File

    Hi, I have an awk script that I've been using to parse some data from a file. The source data has some things that are inaccurate, so I'd like to replace certain strings with data from another file. Here's what I originally was using for one section: /^department:/{departmentnumber =...
  5. johngiggs

    PHP 5.3.3 vs. PHP 5.4.16

    Hi, I finally resolved the issue. I found that "PrivateTmp=true" is set in /usr/lib/systemd/system/httpd.service. I set it to false which resolved the issue. systemctl daemon-reload service httpd restart Thanks, John
  6. johngiggs

    PHP 5.3.3 vs. PHP 5.4.16

    Hi, Does anyone have any troubleshooting tips or ideas? It was a simple HTML form and PHP script, but it's no longer working on the new OS and PHP version. If there's an alternate way to achieve the same thing I'd be open to doing it another way. Thanks, John
  7. johngiggs

    PHP 5.3.3 vs. PHP 5.4.16

    Hi, I tried removing the header redirects, but I'm not seeing any logging to indicate what the problem is. As I mentioned, I run the same php code and form on CentOS 5 and 6 with earlier versions of PHP and don't have any issues. This issue is on CentOS 7 with PHP 5.4.16. Any other thoughts...
  8. johngiggs

    PHP 5.3.3 vs. PHP 5.4.16

    Hi feherke, The only issue I'm having is that when I fill out the form on the HTML page it's not creating the .txt file. All I'm attempting to do is to have the 2 form fields write to a text file. I have the code working fine on a few different machines, but for some reason in this case the...
  9. johngiggs

    PHP 5.3.3 vs. PHP 5.4.16

    I have a PHP script which I'm using in a html form. It works fine in PHP 5.3.3, but not on 5.4.16. <?PHP $filename = "/tmp/restart.txt"; #Must CHMOD to 666 $text = $_POST['requester']; # Form must use POST. if it uses GET, use the line below: $text2 = $_POST['reason']; # Form must use POST...
  10. johngiggs

    Regex Question

    Hi, I tried the following, but I don't think it's fully working as expected. SetEnvIf Origin "^http(s)?://(.+\-)?(.+\.)?(mysite\.org|mysite2\.com)$" CORS_ALLOW_ORIGIN=$0 Any thoughts on what's needed to support URLs like this: uat-www.mysite.org dev-www.mysite.org uat-www.mysite2.com...
  11. johngiggs

    Regex Question

    ...Currently I'm using the following: SetEnvIf Origin "^http(s)?://(.+\.)?(mysite\.org|mysite2\.com)$" CORS_ALLOW_ORIGIN=$0 This should allow *.mysite.org and *.mysite2.com via CORS. The problem I'm encountering is that if the DNS record contains a dash (i.e. uat-www.mysite.org) it does not...
  12. johngiggs

    Apache RewriteRule or RewriteCond

    Hi Feherke, Thank you for the tip. I had no such luck with the RewriteRule running Apache 2.2.15. Also, I don't think the rule you mentioned would also strip off any trailing ?null string, but I suspect that could be a 3rd variable you add to the string. Any other suggestions? Thanks, John
  13. johngiggs

    Apache RewriteRule or RewriteCond

    Hi, I've been trying to craft a RewriteRule to alleviate an issue we're seeing with some inbound links. Something is appending ?null to the URL. I tried several RewriteCond and RewriteRule options I could think of to no avail. A sample URL is...
  14. johngiggs

    Help Splitting Field of Input File

    Hi, I was able to get this one-liner working when it wasn't with other code: /^departmentNumber:/{FS="-"; gsub("departmentNumber: ", "") ; departmentnumber = $1; department = $2; fulldepartmentname = $1"-"$2} But when I put it back in my awk script it breaks and doesn't print anything at...
  15. johngiggs

    print from a string to the end of line

    Hi, I'm sure feherke's is much more efficient, but I came up with this: ps | awk -F'--log-file=' '/log-file/{print $2}' | awk '{print $1}' Thanks, John
  16. johngiggs

    Help Splitting Field of Input File

    Hi, I'm writing an awk script to parse an input file. The input file has many fields about a user. There is one field I need to break up into pieces. ... givenName: John sn: Smith st: CA postalCode: 90210 departmentNumber: 999-IT Department ... I am already calling the script with awk -F"...
  17. johngiggs

    Help with setting destination of uploaded file dynamically

    Hi jpadie, Thank you for your feedback. It's behind Apache authentication and is internal only, so I think I should be all set. Thanks, John
  18. johngiggs

    Help with setting destination of uploaded file dynamically

    I'm all set now. I figured it out. <?php if(isset($_POST['destination'])) $target_path= $_POST['destination']; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename(...
  19. johngiggs

    Help with setting destination of uploaded file dynamically

    I have a basic PHP script that I use to upload files. I can hard code the destination in the PHP script, but I want to set it dynamically via a variable I issue via curl. Here's the script I am working on: <?php $target_path = "$destination"; $target_path = $target_path . basename(...
  20. johngiggs

    Display selected fields from one sheet on a new sheet in alphabetical order

    Hi Skip, Thank you for the help! I am using Google docs for this item and I took your suggestion and tried using a pivot table which worked great! The tutorial is available here: http://googleenterprise.blogspot.com/2011/05/pivot-tables-now-in-google-spreadsheets.html John

Part and Inventory Search

Back
Top